
kernel：     文件格式 elf32-i386


Disassembly of section .text:

80100000 <multiboot_header>:
80100000:	02 b0 ad 1b 00 00    	add    0x1bad(%eax),%dh
80100006:	00 00                	add    %al,(%eax)
80100008:	fe 4f 52             	decb   0x52(%edi)
8010000b:	e4                   	.byte 0xe4

8010000c <entry>:

# Entering xv6 on boot processor, with paging off.
.globl entry
entry:
  # Turn on page size extension for 4Mbyte pages
  movl    %cr4, %eax
8010000c:	0f 20 e0             	mov    %cr4,%eax
  orl     $(CR4_PSE), %eax
8010000f:	83 c8 10             	or     $0x10,%eax
  movl    %eax, %cr4
80100012:	0f 22 e0             	mov    %eax,%cr4
  # Set page directory
  movl    $(V2P_WO(entrypgdir)), %eax
80100015:	b8 00 a0 10 00       	mov    $0x10a000,%eax
  movl    %eax, %cr3
8010001a:	0f 22 d8             	mov    %eax,%cr3
  # Turn on paging.
  movl    %cr0, %eax
8010001d:	0f 20 c0             	mov    %cr0,%eax
  orl     $(CR0_PG|CR0_WP), %eax
80100020:	0d 00 00 01 80       	or     $0x80010000,%eax
  movl    %eax, %cr0
80100025:	0f 22 c0             	mov    %eax,%cr0

  # Set up the stack pointer.
  movl $(stack + KSTACKSIZE), %esp
80100028:	bc d0 e6 11 80       	mov    $0x8011e6d0,%esp

  # Jump to main(), and switch to executing at
  # high addresses. The indirect call is needed because
  # the assembler produces a PC-relative instruction
  # for a direct jump.
  mov $main, %eax
8010002d:	b8 80 30 10 80       	mov    $0x80103080,%eax
  jmp *%eax
80100032:	ff e0                	jmp    *%eax
80100034:	66 90                	xchg   %ax,%ax
80100036:	66 90                	xchg   %ax,%ax
80100038:	66 90                	xchg   %ax,%ax
8010003a:	66 90                	xchg   %ax,%ax
8010003c:	66 90                	xchg   %ax,%ax
8010003e:	66 90                	xchg   %ax,%ax

80100040 <binit>:
  struct buf head;
} bcache;

void
binit(void)
{
80100040:	55                   	push   %ebp
80100041:	89 e5                	mov    %esp,%ebp
80100043:	53                   	push   %ebx

//PAGEBREAK!
  // Create linked list of buffers
  bcache.head.prev = &bcache.head;
  bcache.head.next = &bcache.head;
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100044:	bb 54 b5 10 80       	mov    $0x8010b554,%ebx
{
80100049:	83 ec 0c             	sub    $0xc,%esp
  initlock(&bcache.lock, "bcache");
8010004c:	68 40 79 10 80       	push   $0x80107940
80100051:	68 20 b5 10 80       	push   $0x8010b520
80100056:	e8 35 49 00 00       	call   80104990 <initlock>
  bcache.head.next = &bcache.head;
8010005b:	83 c4 10             	add    $0x10,%esp
8010005e:	b8 1c fc 10 80       	mov    $0x8010fc1c,%eax
  bcache.head.prev = &bcache.head;
80100063:	c7 05 6c fc 10 80 1c 	movl   $0x8010fc1c,0x8010fc6c
8010006a:	fc 10 80 
  bcache.head.next = &bcache.head;
8010006d:	c7 05 70 fc 10 80 1c 	movl   $0x8010fc1c,0x8010fc70
80100074:	fc 10 80 
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
80100077:	eb 09                	jmp    80100082 <binit+0x42>
80100079:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100080:	89 d3                	mov    %edx,%ebx
    b->next = bcache.head.next;
80100082:	89 43 54             	mov    %eax,0x54(%ebx)
    b->prev = &bcache.head;
    initsleeplock(&b->lock, "buffer");
80100085:	83 ec 08             	sub    $0x8,%esp
80100088:	8d 43 0c             	lea    0xc(%ebx),%eax
    b->prev = &bcache.head;
8010008b:	c7 43 50 1c fc 10 80 	movl   $0x8010fc1c,0x50(%ebx)
    initsleeplock(&b->lock, "buffer");
80100092:	68 47 79 10 80       	push   $0x80107947
80100097:	50                   	push   %eax
80100098:	e8 e3 47 00 00       	call   80104880 <initsleeplock>
    bcache.head.next->prev = b;
8010009d:	a1 70 fc 10 80       	mov    0x8010fc70,%eax
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000a2:	8d 93 5c 02 00 00    	lea    0x25c(%ebx),%edx
801000a8:	83 c4 10             	add    $0x10,%esp
    bcache.head.next->prev = b;
801000ab:	89 58 50             	mov    %ebx,0x50(%eax)
    bcache.head.next = b;
801000ae:	89 d8                	mov    %ebx,%eax
801000b0:	89 1d 70 fc 10 80    	mov    %ebx,0x8010fc70
  for(b = bcache.buf; b < bcache.buf+NBUF; b++){
801000b6:	81 fb c0 f9 10 80    	cmp    $0x8010f9c0,%ebx
801000bc:	75 c2                	jne    80100080 <binit+0x40>
  }
}
801000be:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801000c1:	c9                   	leave  
801000c2:	c3                   	ret    
801000c3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801000ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801000d0 <bread>:
}

// Return a locked buf with the contents of the indicated block.
struct buf*
bread(uint dev, uint blockno)
{
801000d0:	55                   	push   %ebp
801000d1:	89 e5                	mov    %esp,%ebp
801000d3:	57                   	push   %edi
801000d4:	56                   	push   %esi
801000d5:	53                   	push   %ebx
801000d6:	83 ec 18             	sub    $0x18,%esp
801000d9:	8b 75 08             	mov    0x8(%ebp),%esi
801000dc:	8b 7d 0c             	mov    0xc(%ebp),%edi
  acquire(&bcache.lock);
801000df:	68 20 b5 10 80       	push   $0x8010b520
801000e4:	e8 b7 49 00 00       	call   80104aa0 <acquire>
  for(b = bcache.head.next; b != &bcache.head; b = b->next){
801000e9:	8b 1d 70 fc 10 80    	mov    0x8010fc70,%ebx
801000ef:	83 c4 10             	add    $0x10,%esp
801000f2:	81 fb 1c fc 10 80    	cmp    $0x8010fc1c,%ebx
801000f8:	75 11                	jne    8010010b <bread+0x3b>
801000fa:	eb 24                	jmp    80100120 <bread+0x50>
801000fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100100:	8b 5b 54             	mov    0x54(%ebx),%ebx
80100103:	81 fb 1c fc 10 80    	cmp    $0x8010fc1c,%ebx
80100109:	74 15                	je     80100120 <bread+0x50>
    if(b->dev == dev && b->blockno == blockno){
8010010b:	3b 73 04             	cmp    0x4(%ebx),%esi
8010010e:	75 f0                	jne    80100100 <bread+0x30>
80100110:	3b 7b 08             	cmp    0x8(%ebx),%edi
80100113:	75 eb                	jne    80100100 <bread+0x30>
      b->refcnt++;
80100115:	83 43 4c 01          	addl   $0x1,0x4c(%ebx)
      release(&bcache.lock);
80100119:	eb 3f                	jmp    8010015a <bread+0x8a>
8010011b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010011f:	90                   	nop
  for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
80100120:	8b 1d 6c fc 10 80    	mov    0x8010fc6c,%ebx
80100126:	81 fb 1c fc 10 80    	cmp    $0x8010fc1c,%ebx
8010012c:	75 0d                	jne    8010013b <bread+0x6b>
8010012e:	eb 6e                	jmp    8010019e <bread+0xce>
80100130:	8b 5b 50             	mov    0x50(%ebx),%ebx
80100133:	81 fb 1c fc 10 80    	cmp    $0x8010fc1c,%ebx
80100139:	74 63                	je     8010019e <bread+0xce>
    if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
8010013b:	8b 43 4c             	mov    0x4c(%ebx),%eax
8010013e:	85 c0                	test   %eax,%eax
80100140:	75 ee                	jne    80100130 <bread+0x60>
80100142:	f6 03 04             	testb  $0x4,(%ebx)
80100145:	75 e9                	jne    80100130 <bread+0x60>
      b->dev = dev;
80100147:	89 73 04             	mov    %esi,0x4(%ebx)
      b->blockno = blockno;
8010014a:	89 7b 08             	mov    %edi,0x8(%ebx)
      b->flags = 0;
8010014d:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
      b->refcnt = 1;
80100153:	c7 43 4c 01 00 00 00 	movl   $0x1,0x4c(%ebx)
      release(&bcache.lock);
8010015a:	83 ec 0c             	sub    $0xc,%esp
8010015d:	68 20 b5 10 80       	push   $0x8010b520
80100162:	e8 59 4a 00 00       	call   80104bc0 <release>
      acquiresleep(&b->lock);
80100167:	8d 43 0c             	lea    0xc(%ebx),%eax
8010016a:	89 04 24             	mov    %eax,(%esp)
8010016d:	e8 4e 47 00 00       	call   801048c0 <acquiresleep>
      return b;
80100172:	83 c4 10             	add    $0x10,%esp
  struct buf *b;

  b = bget(dev, blockno);
  if((b->flags & B_VALID) == 0) {
80100175:	f6 03 02             	testb  $0x2,(%ebx)
80100178:	74 0e                	je     80100188 <bread+0xb8>
    iderw(b);
  }
  return b;
}
8010017a:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010017d:	89 d8                	mov    %ebx,%eax
8010017f:	5b                   	pop    %ebx
80100180:	5e                   	pop    %esi
80100181:	5f                   	pop    %edi
80100182:	5d                   	pop    %ebp
80100183:	c3                   	ret    
80100184:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    iderw(b);
80100188:	83 ec 0c             	sub    $0xc,%esp
8010018b:	53                   	push   %ebx
8010018c:	e8 6f 21 00 00       	call   80102300 <iderw>
80100191:	83 c4 10             	add    $0x10,%esp
}
80100194:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100197:	89 d8                	mov    %ebx,%eax
80100199:	5b                   	pop    %ebx
8010019a:	5e                   	pop    %esi
8010019b:	5f                   	pop    %edi
8010019c:	5d                   	pop    %ebp
8010019d:	c3                   	ret    
  panic("bget: no buffers");
8010019e:	83 ec 0c             	sub    $0xc,%esp
801001a1:	68 4e 79 10 80       	push   $0x8010794e
801001a6:	e8 d5 01 00 00       	call   80100380 <panic>
801001ab:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801001af:	90                   	nop

801001b0 <bwrite>:

// Write b's contents to disk.  Must be locked.
void
bwrite(struct buf *b)
{
801001b0:	55                   	push   %ebp
801001b1:	89 e5                	mov    %esp,%ebp
801001b3:	53                   	push   %ebx
801001b4:	83 ec 10             	sub    $0x10,%esp
801001b7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(!holdingsleep(&b->lock))
801001ba:	8d 43 0c             	lea    0xc(%ebx),%eax
801001bd:	50                   	push   %eax
801001be:	e8 9d 47 00 00       	call   80104960 <holdingsleep>
801001c3:	83 c4 10             	add    $0x10,%esp
801001c6:	85 c0                	test   %eax,%eax
801001c8:	74 0f                	je     801001d9 <bwrite+0x29>
    panic("bwrite");
  b->flags |= B_DIRTY;
801001ca:	83 0b 04             	orl    $0x4,(%ebx)
  iderw(b);
801001cd:	89 5d 08             	mov    %ebx,0x8(%ebp)
}
801001d0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801001d3:	c9                   	leave  
  iderw(b);
801001d4:	e9 27 21 00 00       	jmp    80102300 <iderw>
    panic("bwrite");
801001d9:	83 ec 0c             	sub    $0xc,%esp
801001dc:	68 5f 79 10 80       	push   $0x8010795f
801001e1:	e8 9a 01 00 00       	call   80100380 <panic>
801001e6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801001ed:	8d 76 00             	lea    0x0(%esi),%esi

801001f0 <brelse>:

// Release a locked buffer.
// Move to the head of the MRU list.
void
brelse(struct buf *b)
{
801001f0:	55                   	push   %ebp
801001f1:	89 e5                	mov    %esp,%ebp
801001f3:	56                   	push   %esi
801001f4:	53                   	push   %ebx
801001f5:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(!holdingsleep(&b->lock))
801001f8:	8d 73 0c             	lea    0xc(%ebx),%esi
801001fb:	83 ec 0c             	sub    $0xc,%esp
801001fe:	56                   	push   %esi
801001ff:	e8 5c 47 00 00       	call   80104960 <holdingsleep>
80100204:	83 c4 10             	add    $0x10,%esp
80100207:	85 c0                	test   %eax,%eax
80100209:	74 66                	je     80100271 <brelse+0x81>
    panic("brelse");

  releasesleep(&b->lock);
8010020b:	83 ec 0c             	sub    $0xc,%esp
8010020e:	56                   	push   %esi
8010020f:	e8 0c 47 00 00       	call   80104920 <releasesleep>

  acquire(&bcache.lock);
80100214:	c7 04 24 20 b5 10 80 	movl   $0x8010b520,(%esp)
8010021b:	e8 80 48 00 00       	call   80104aa0 <acquire>
  b->refcnt--;
80100220:	8b 43 4c             	mov    0x4c(%ebx),%eax
  if (b->refcnt == 0) {
80100223:	83 c4 10             	add    $0x10,%esp
  b->refcnt--;
80100226:	83 e8 01             	sub    $0x1,%eax
80100229:	89 43 4c             	mov    %eax,0x4c(%ebx)
  if (b->refcnt == 0) {
8010022c:	85 c0                	test   %eax,%eax
8010022e:	75 2f                	jne    8010025f <brelse+0x6f>
    // no one is waiting for it.
    b->next->prev = b->prev;
80100230:	8b 43 54             	mov    0x54(%ebx),%eax
80100233:	8b 53 50             	mov    0x50(%ebx),%edx
80100236:	89 50 50             	mov    %edx,0x50(%eax)
    b->prev->next = b->next;
80100239:	8b 43 50             	mov    0x50(%ebx),%eax
8010023c:	8b 53 54             	mov    0x54(%ebx),%edx
8010023f:	89 50 54             	mov    %edx,0x54(%eax)
    b->next = bcache.head.next;
80100242:	a1 70 fc 10 80       	mov    0x8010fc70,%eax
    b->prev = &bcache.head;
80100247:	c7 43 50 1c fc 10 80 	movl   $0x8010fc1c,0x50(%ebx)
    b->next = bcache.head.next;
8010024e:	89 43 54             	mov    %eax,0x54(%ebx)
    bcache.head.next->prev = b;
80100251:	a1 70 fc 10 80       	mov    0x8010fc70,%eax
80100256:	89 58 50             	mov    %ebx,0x50(%eax)
    bcache.head.next = b;
80100259:	89 1d 70 fc 10 80    	mov    %ebx,0x8010fc70
  }
  
  release(&bcache.lock);
8010025f:	c7 45 08 20 b5 10 80 	movl   $0x8010b520,0x8(%ebp)
}
80100266:	8d 65 f8             	lea    -0x8(%ebp),%esp
80100269:	5b                   	pop    %ebx
8010026a:	5e                   	pop    %esi
8010026b:	5d                   	pop    %ebp
  release(&bcache.lock);
8010026c:	e9 4f 49 00 00       	jmp    80104bc0 <release>
    panic("brelse");
80100271:	83 ec 0c             	sub    $0xc,%esp
80100274:	68 66 79 10 80       	push   $0x80107966
80100279:	e8 02 01 00 00       	call   80100380 <panic>
8010027e:	66 90                	xchg   %ax,%ax

80100280 <consoleread>:
  }
}

int
consoleread(struct inode *ip, char *dst, int n)
{
80100280:	55                   	push   %ebp
80100281:	89 e5                	mov    %esp,%ebp
80100283:	57                   	push   %edi
80100284:	56                   	push   %esi
80100285:	53                   	push   %ebx
80100286:	83 ec 18             	sub    $0x18,%esp
80100289:	8b 5d 10             	mov    0x10(%ebp),%ebx
8010028c:	8b 75 0c             	mov    0xc(%ebp),%esi
  uint target;
  int c;

  iunlock(ip);
8010028f:	ff 75 08             	push   0x8(%ebp)
  target = n;
80100292:	89 df                	mov    %ebx,%edi
  iunlock(ip);
80100294:	e8 e7 15 00 00       	call   80101880 <iunlock>
  acquire(&cons.lock);
80100299:	c7 04 24 20 ff 10 80 	movl   $0x8010ff20,(%esp)
801002a0:	e8 fb 47 00 00       	call   80104aa0 <acquire>
  while(n > 0){
801002a5:	83 c4 10             	add    $0x10,%esp
801002a8:	85 db                	test   %ebx,%ebx
801002aa:	0f 8e 94 00 00 00    	jle    80100344 <consoleread+0xc4>
    while(input.r == input.w){
801002b0:	a1 00 ff 10 80       	mov    0x8010ff00,%eax
801002b5:	3b 05 04 ff 10 80    	cmp    0x8010ff04,%eax
801002bb:	74 25                	je     801002e2 <consoleread+0x62>
801002bd:	eb 59                	jmp    80100318 <consoleread+0x98>
801002bf:	90                   	nop
      if(myproc()->killed){
        release(&cons.lock);
        ilock(ip);
        return -1;
      }
      sleep(&input.r, &cons.lock);
801002c0:	83 ec 08             	sub    $0x8,%esp
801002c3:	68 20 ff 10 80       	push   $0x8010ff20
801002c8:	68 00 ff 10 80       	push   $0x8010ff00
801002cd:	e8 2e 3f 00 00       	call   80104200 <sleep>
    while(input.r == input.w){
801002d2:	a1 00 ff 10 80       	mov    0x8010ff00,%eax
801002d7:	83 c4 10             	add    $0x10,%esp
801002da:	3b 05 04 ff 10 80    	cmp    0x8010ff04,%eax
801002e0:	75 36                	jne    80100318 <consoleread+0x98>
      if(myproc()->killed){
801002e2:	e8 b9 36 00 00       	call   801039a0 <myproc>
801002e7:	8b 48 24             	mov    0x24(%eax),%ecx
801002ea:	85 c9                	test   %ecx,%ecx
801002ec:	74 d2                	je     801002c0 <consoleread+0x40>
        release(&cons.lock);
801002ee:	83 ec 0c             	sub    $0xc,%esp
801002f1:	68 20 ff 10 80       	push   $0x8010ff20
801002f6:	e8 c5 48 00 00       	call   80104bc0 <release>
        ilock(ip);
801002fb:	5a                   	pop    %edx
801002fc:	ff 75 08             	push   0x8(%ebp)
801002ff:	e8 9c 14 00 00       	call   801017a0 <ilock>
        return -1;
80100304:	83 c4 10             	add    $0x10,%esp
  }
  release(&cons.lock);
  ilock(ip);

  return target - n;
}
80100307:	8d 65 f4             	lea    -0xc(%ebp),%esp
        return -1;
8010030a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
8010030f:	5b                   	pop    %ebx
80100310:	5e                   	pop    %esi
80100311:	5f                   	pop    %edi
80100312:	5d                   	pop    %ebp
80100313:	c3                   	ret    
80100314:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    c = input.buf[input.r++ % INPUT_BUF];
80100318:	8d 50 01             	lea    0x1(%eax),%edx
8010031b:	89 15 00 ff 10 80    	mov    %edx,0x8010ff00
80100321:	89 c2                	mov    %eax,%edx
80100323:	83 e2 7f             	and    $0x7f,%edx
80100326:	0f be 8a 80 fe 10 80 	movsbl -0x7fef0180(%edx),%ecx
    if(c == C('D')){  // EOF
8010032d:	80 f9 04             	cmp    $0x4,%cl
80100330:	74 37                	je     80100369 <consoleread+0xe9>
    *dst++ = c;
80100332:	83 c6 01             	add    $0x1,%esi
    --n;
80100335:	83 eb 01             	sub    $0x1,%ebx
    *dst++ = c;
80100338:	88 4e ff             	mov    %cl,-0x1(%esi)
    if(c == '\n')
8010033b:	83 f9 0a             	cmp    $0xa,%ecx
8010033e:	0f 85 64 ff ff ff    	jne    801002a8 <consoleread+0x28>
  release(&cons.lock);
80100344:	83 ec 0c             	sub    $0xc,%esp
80100347:	68 20 ff 10 80       	push   $0x8010ff20
8010034c:	e8 6f 48 00 00       	call   80104bc0 <release>
  ilock(ip);
80100351:	58                   	pop    %eax
80100352:	ff 75 08             	push   0x8(%ebp)
80100355:	e8 46 14 00 00       	call   801017a0 <ilock>
  return target - n;
8010035a:	89 f8                	mov    %edi,%eax
8010035c:	83 c4 10             	add    $0x10,%esp
}
8010035f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return target - n;
80100362:	29 d8                	sub    %ebx,%eax
}
80100364:	5b                   	pop    %ebx
80100365:	5e                   	pop    %esi
80100366:	5f                   	pop    %edi
80100367:	5d                   	pop    %ebp
80100368:	c3                   	ret    
      if(n < target){
80100369:	39 fb                	cmp    %edi,%ebx
8010036b:	73 d7                	jae    80100344 <consoleread+0xc4>
        input.r--;
8010036d:	a3 00 ff 10 80       	mov    %eax,0x8010ff00
80100372:	eb d0                	jmp    80100344 <consoleread+0xc4>
80100374:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010037b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010037f:	90                   	nop

80100380 <panic>:
{
80100380:	55                   	push   %ebp
80100381:	89 e5                	mov    %esp,%ebp
80100383:	56                   	push   %esi
80100384:	53                   	push   %ebx
80100385:	83 ec 30             	sub    $0x30,%esp
}

static inline void
cli(void)
{
  asm volatile("cli");
80100388:	fa                   	cli    
  cons.locking = 0;
80100389:	c7 05 54 ff 10 80 00 	movl   $0x0,0x8010ff54
80100390:	00 00 00 
  getcallerpcs(&s, pcs);
80100393:	8d 5d d0             	lea    -0x30(%ebp),%ebx
80100396:	8d 75 f8             	lea    -0x8(%ebp),%esi
  cprintf("lapicid %d: panic: ", lapicid());
80100399:	e8 72 25 00 00       	call   80102910 <lapicid>
8010039e:	83 ec 08             	sub    $0x8,%esp
801003a1:	50                   	push   %eax
801003a2:	68 6d 79 10 80       	push   $0x8010796d
801003a7:	e8 f4 02 00 00       	call   801006a0 <cprintf>
  cprintf(s);
801003ac:	58                   	pop    %eax
801003ad:	ff 75 08             	push   0x8(%ebp)
801003b0:	e8 eb 02 00 00       	call   801006a0 <cprintf>
  cprintf("\n");
801003b5:	c7 04 24 f7 82 10 80 	movl   $0x801082f7,(%esp)
801003bc:	e8 df 02 00 00       	call   801006a0 <cprintf>
  getcallerpcs(&s, pcs);
801003c1:	8d 45 08             	lea    0x8(%ebp),%eax
801003c4:	5a                   	pop    %edx
801003c5:	59                   	pop    %ecx
801003c6:	53                   	push   %ebx
801003c7:	50                   	push   %eax
801003c8:	e8 e3 45 00 00       	call   801049b0 <getcallerpcs>
  for(i=0; i<10; i++)
801003cd:	83 c4 10             	add    $0x10,%esp
    cprintf(" %p", pcs[i]);
801003d0:	83 ec 08             	sub    $0x8,%esp
801003d3:	ff 33                	push   (%ebx)
  for(i=0; i<10; i++)
801003d5:	83 c3 04             	add    $0x4,%ebx
    cprintf(" %p", pcs[i]);
801003d8:	68 81 79 10 80       	push   $0x80107981
801003dd:	e8 be 02 00 00       	call   801006a0 <cprintf>
  for(i=0; i<10; i++)
801003e2:	83 c4 10             	add    $0x10,%esp
801003e5:	39 f3                	cmp    %esi,%ebx
801003e7:	75 e7                	jne    801003d0 <panic+0x50>
  panicked = 1; // freeze other CPU
801003e9:	c7 05 58 ff 10 80 01 	movl   $0x1,0x8010ff58
801003f0:	00 00 00 
  for(;;)
801003f3:	eb fe                	jmp    801003f3 <panic+0x73>
801003f5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801003fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80100400 <consputc.part.0>:
consputc(int c)
80100400:	55                   	push   %ebp
80100401:	89 e5                	mov    %esp,%ebp
80100403:	57                   	push   %edi
80100404:	56                   	push   %esi
80100405:	53                   	push   %ebx
80100406:	89 c3                	mov    %eax,%ebx
80100408:	83 ec 1c             	sub    $0x1c,%esp
  if(c == BACKSPACE){
8010040b:	3d 00 01 00 00       	cmp    $0x100,%eax
80100410:	0f 84 ea 00 00 00    	je     80100500 <consputc.part.0+0x100>
    uartputc(c);
80100416:	83 ec 0c             	sub    $0xc,%esp
80100419:	50                   	push   %eax
8010041a:	e8 51 60 00 00       	call   80106470 <uartputc>
8010041f:	83 c4 10             	add    $0x10,%esp
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100422:	bf d4 03 00 00       	mov    $0x3d4,%edi
80100427:	b8 0e 00 00 00       	mov    $0xe,%eax
8010042c:	89 fa                	mov    %edi,%edx
8010042e:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010042f:	be d5 03 00 00       	mov    $0x3d5,%esi
80100434:	89 f2                	mov    %esi,%edx
80100436:	ec                   	in     (%dx),%al
  pos = inb(CRTPORT+1) << 8;
80100437:	0f b6 c8             	movzbl %al,%ecx
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010043a:	89 fa                	mov    %edi,%edx
8010043c:	b8 0f 00 00 00       	mov    $0xf,%eax
80100441:	c1 e1 08             	shl    $0x8,%ecx
80100444:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80100445:	89 f2                	mov    %esi,%edx
80100447:	ec                   	in     (%dx),%al
  pos |= inb(CRTPORT+1);
80100448:	0f b6 c0             	movzbl %al,%eax
8010044b:	09 c8                	or     %ecx,%eax
  if(c == '\n')
8010044d:	83 fb 0a             	cmp    $0xa,%ebx
80100450:	0f 84 92 00 00 00    	je     801004e8 <consputc.part.0+0xe8>
  else if(c == BACKSPACE){
80100456:	81 fb 00 01 00 00    	cmp    $0x100,%ebx
8010045c:	74 72                	je     801004d0 <consputc.part.0+0xd0>
    crt[pos++] = (c&0xff) | 0x0700;  // black on white
8010045e:	0f b6 db             	movzbl %bl,%ebx
80100461:	8d 70 01             	lea    0x1(%eax),%esi
80100464:	80 cf 07             	or     $0x7,%bh
80100467:	66 89 9c 00 00 80 0b 	mov    %bx,-0x7ff48000(%eax,%eax,1)
8010046e:	80 
  if(pos < 0 || pos > 25*80)
8010046f:	81 fe d0 07 00 00    	cmp    $0x7d0,%esi
80100475:	0f 8f fb 00 00 00    	jg     80100576 <consputc.part.0+0x176>
  if((pos/80) >= 24){  // Scroll up.
8010047b:	81 fe 7f 07 00 00    	cmp    $0x77f,%esi
80100481:	0f 8f a9 00 00 00    	jg     80100530 <consputc.part.0+0x130>
  outb(CRTPORT+1, pos>>8);
80100487:	89 f0                	mov    %esi,%eax
  crt[pos] = ' ' | 0x0700;
80100489:	8d b4 36 00 80 0b 80 	lea    -0x7ff48000(%esi,%esi,1),%esi
  outb(CRTPORT+1, pos);
80100490:	88 45 e7             	mov    %al,-0x19(%ebp)
  outb(CRTPORT+1, pos>>8);
80100493:	0f b6 fc             	movzbl %ah,%edi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80100496:	bb d4 03 00 00       	mov    $0x3d4,%ebx
8010049b:	b8 0e 00 00 00       	mov    $0xe,%eax
801004a0:	89 da                	mov    %ebx,%edx
801004a2:	ee                   	out    %al,(%dx)
801004a3:	b9 d5 03 00 00       	mov    $0x3d5,%ecx
801004a8:	89 f8                	mov    %edi,%eax
801004aa:	89 ca                	mov    %ecx,%edx
801004ac:	ee                   	out    %al,(%dx)
801004ad:	b8 0f 00 00 00       	mov    $0xf,%eax
801004b2:	89 da                	mov    %ebx,%edx
801004b4:	ee                   	out    %al,(%dx)
801004b5:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
801004b9:	89 ca                	mov    %ecx,%edx
801004bb:	ee                   	out    %al,(%dx)
  crt[pos] = ' ' | 0x0700;
801004bc:	b8 20 07 00 00       	mov    $0x720,%eax
801004c1:	66 89 06             	mov    %ax,(%esi)
}
801004c4:	8d 65 f4             	lea    -0xc(%ebp),%esp
801004c7:	5b                   	pop    %ebx
801004c8:	5e                   	pop    %esi
801004c9:	5f                   	pop    %edi
801004ca:	5d                   	pop    %ebp
801004cb:	c3                   	ret    
801004cc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(pos > 0) --pos;
801004d0:	8d 70 ff             	lea    -0x1(%eax),%esi
801004d3:	85 c0                	test   %eax,%eax
801004d5:	75 98                	jne    8010046f <consputc.part.0+0x6f>
801004d7:	c6 45 e7 00          	movb   $0x0,-0x19(%ebp)
801004db:	be 00 80 0b 80       	mov    $0x800b8000,%esi
801004e0:	31 ff                	xor    %edi,%edi
801004e2:	eb b2                	jmp    80100496 <consputc.part.0+0x96>
801004e4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    pos += 80 - pos%80;
801004e8:	ba cd cc cc cc       	mov    $0xcccccccd,%edx
801004ed:	f7 e2                	mul    %edx
801004ef:	c1 ea 06             	shr    $0x6,%edx
801004f2:	8d 04 92             	lea    (%edx,%edx,4),%eax
801004f5:	c1 e0 04             	shl    $0x4,%eax
801004f8:	8d 70 50             	lea    0x50(%eax),%esi
801004fb:	e9 6f ff ff ff       	jmp    8010046f <consputc.part.0+0x6f>
    uartputc('\b'); uartputc(' '); uartputc('\b');
80100500:	83 ec 0c             	sub    $0xc,%esp
80100503:	6a 08                	push   $0x8
80100505:	e8 66 5f 00 00       	call   80106470 <uartputc>
8010050a:	c7 04 24 20 00 00 00 	movl   $0x20,(%esp)
80100511:	e8 5a 5f 00 00       	call   80106470 <uartputc>
80100516:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
8010051d:	e8 4e 5f 00 00       	call   80106470 <uartputc>
80100522:	83 c4 10             	add    $0x10,%esp
80100525:	e9 f8 fe ff ff       	jmp    80100422 <consputc.part.0+0x22>
8010052a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100530:	83 ec 04             	sub    $0x4,%esp
    pos -= 80;
80100533:	8d 5e b0             	lea    -0x50(%esi),%ebx
    memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80100536:	8d b4 36 60 7f 0b 80 	lea    -0x7ff480a0(%esi,%esi,1),%esi
  outb(CRTPORT+1, pos);
8010053d:	bf 07 00 00 00       	mov    $0x7,%edi
    memmove(crt, crt+80, sizeof(crt[0])*23*80);
80100542:	68 60 0e 00 00       	push   $0xe60
80100547:	68 a0 80 0b 80       	push   $0x800b80a0
8010054c:	68 00 80 0b 80       	push   $0x800b8000
80100551:	e8 5a 47 00 00       	call   80104cb0 <memmove>
    memset(crt+pos, 0, sizeof(crt[0])*(24*80 - pos));
80100556:	b8 80 07 00 00       	mov    $0x780,%eax
8010055b:	83 c4 0c             	add    $0xc,%esp
8010055e:	29 d8                	sub    %ebx,%eax
80100560:	01 c0                	add    %eax,%eax
80100562:	50                   	push   %eax
80100563:	6a 00                	push   $0x0
80100565:	56                   	push   %esi
80100566:	e8 a5 46 00 00       	call   80104c10 <memset>
  outb(CRTPORT+1, pos);
8010056b:	88 5d e7             	mov    %bl,-0x19(%ebp)
8010056e:	83 c4 10             	add    $0x10,%esp
80100571:	e9 20 ff ff ff       	jmp    80100496 <consputc.part.0+0x96>
    panic("pos under/overflow");
80100576:	83 ec 0c             	sub    $0xc,%esp
80100579:	68 85 79 10 80       	push   $0x80107985
8010057e:	e8 fd fd ff ff       	call   80100380 <panic>
80100583:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010058a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80100590 <consolewrite>:

int
consolewrite(struct inode *ip, char *buf, int n)
{
80100590:	55                   	push   %ebp
80100591:	89 e5                	mov    %esp,%ebp
80100593:	57                   	push   %edi
80100594:	56                   	push   %esi
80100595:	53                   	push   %ebx
80100596:	83 ec 18             	sub    $0x18,%esp
  int i;

  iunlock(ip);
80100599:	ff 75 08             	push   0x8(%ebp)
{
8010059c:	8b 75 10             	mov    0x10(%ebp),%esi
  iunlock(ip);
8010059f:	e8 dc 12 00 00       	call   80101880 <iunlock>
  acquire(&cons.lock);
801005a4:	c7 04 24 20 ff 10 80 	movl   $0x8010ff20,(%esp)
801005ab:	e8 f0 44 00 00       	call   80104aa0 <acquire>
  for(i = 0; i < n; i++)
801005b0:	83 c4 10             	add    $0x10,%esp
801005b3:	85 f6                	test   %esi,%esi
801005b5:	7e 25                	jle    801005dc <consolewrite+0x4c>
801005b7:	8b 5d 0c             	mov    0xc(%ebp),%ebx
801005ba:	8d 3c 33             	lea    (%ebx,%esi,1),%edi
  if(panicked){
801005bd:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
    consputc(buf[i] & 0xff);
801005c3:	0f b6 03             	movzbl (%ebx),%eax
  if(panicked){
801005c6:	85 d2                	test   %edx,%edx
801005c8:	74 06                	je     801005d0 <consolewrite+0x40>
  asm volatile("cli");
801005ca:	fa                   	cli    
    for(;;)
801005cb:	eb fe                	jmp    801005cb <consolewrite+0x3b>
801005cd:	8d 76 00             	lea    0x0(%esi),%esi
801005d0:	e8 2b fe ff ff       	call   80100400 <consputc.part.0>
  for(i = 0; i < n; i++)
801005d5:	83 c3 01             	add    $0x1,%ebx
801005d8:	39 df                	cmp    %ebx,%edi
801005da:	75 e1                	jne    801005bd <consolewrite+0x2d>
  release(&cons.lock);
801005dc:	83 ec 0c             	sub    $0xc,%esp
801005df:	68 20 ff 10 80       	push   $0x8010ff20
801005e4:	e8 d7 45 00 00       	call   80104bc0 <release>
  ilock(ip);
801005e9:	58                   	pop    %eax
801005ea:	ff 75 08             	push   0x8(%ebp)
801005ed:	e8 ae 11 00 00       	call   801017a0 <ilock>

  return n;
}
801005f2:	8d 65 f4             	lea    -0xc(%ebp),%esp
801005f5:	89 f0                	mov    %esi,%eax
801005f7:	5b                   	pop    %ebx
801005f8:	5e                   	pop    %esi
801005f9:	5f                   	pop    %edi
801005fa:	5d                   	pop    %ebp
801005fb:	c3                   	ret    
801005fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80100600 <printint>:
{
80100600:	55                   	push   %ebp
80100601:	89 e5                	mov    %esp,%ebp
80100603:	57                   	push   %edi
80100604:	56                   	push   %esi
80100605:	53                   	push   %ebx
80100606:	83 ec 2c             	sub    $0x2c,%esp
80100609:	89 55 d4             	mov    %edx,-0x2c(%ebp)
8010060c:	89 4d d0             	mov    %ecx,-0x30(%ebp)
  if(sign && (sign = xx < 0))
8010060f:	85 c9                	test   %ecx,%ecx
80100611:	74 04                	je     80100617 <printint+0x17>
80100613:	85 c0                	test   %eax,%eax
80100615:	78 6d                	js     80100684 <printint+0x84>
    x = xx;
80100617:	c7 45 d0 00 00 00 00 	movl   $0x0,-0x30(%ebp)
8010061e:	89 c1                	mov    %eax,%ecx
  i = 0;
80100620:	31 db                	xor    %ebx,%ebx
80100622:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    buf[i++] = digits[x % base];
80100628:	89 c8                	mov    %ecx,%eax
8010062a:	31 d2                	xor    %edx,%edx
8010062c:	89 de                	mov    %ebx,%esi
8010062e:	89 cf                	mov    %ecx,%edi
80100630:	f7 75 d4             	divl   -0x2c(%ebp)
80100633:	8d 5b 01             	lea    0x1(%ebx),%ebx
80100636:	0f b6 92 b0 79 10 80 	movzbl -0x7fef8650(%edx),%edx
  }while((x /= base) != 0);
8010063d:	89 c1                	mov    %eax,%ecx
    buf[i++] = digits[x % base];
8010063f:	88 54 1d d7          	mov    %dl,-0x29(%ebp,%ebx,1)
  }while((x /= base) != 0);
80100643:	3b 7d d4             	cmp    -0x2c(%ebp),%edi
80100646:	73 e0                	jae    80100628 <printint+0x28>
  if(sign)
80100648:	8b 4d d0             	mov    -0x30(%ebp),%ecx
8010064b:	85 c9                	test   %ecx,%ecx
8010064d:	74 0c                	je     8010065b <printint+0x5b>
    buf[i++] = '-';
8010064f:	c6 44 1d d8 2d       	movb   $0x2d,-0x28(%ebp,%ebx,1)
    buf[i++] = digits[x % base];
80100654:	89 de                	mov    %ebx,%esi
    buf[i++] = '-';
80100656:	ba 2d 00 00 00       	mov    $0x2d,%edx
  while(--i >= 0)
8010065b:	8d 5c 35 d7          	lea    -0x29(%ebp,%esi,1),%ebx
8010065f:	0f be c2             	movsbl %dl,%eax
  if(panicked){
80100662:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
80100668:	85 d2                	test   %edx,%edx
8010066a:	74 04                	je     80100670 <printint+0x70>
8010066c:	fa                   	cli    
    for(;;)
8010066d:	eb fe                	jmp    8010066d <printint+0x6d>
8010066f:	90                   	nop
80100670:	e8 8b fd ff ff       	call   80100400 <consputc.part.0>
  while(--i >= 0)
80100675:	8d 45 d7             	lea    -0x29(%ebp),%eax
80100678:	39 c3                	cmp    %eax,%ebx
8010067a:	74 0e                	je     8010068a <printint+0x8a>
    consputc(buf[i]);
8010067c:	0f be 03             	movsbl (%ebx),%eax
8010067f:	83 eb 01             	sub    $0x1,%ebx
80100682:	eb de                	jmp    80100662 <printint+0x62>
    x = -xx;
80100684:	f7 d8                	neg    %eax
80100686:	89 c1                	mov    %eax,%ecx
80100688:	eb 96                	jmp    80100620 <printint+0x20>
}
8010068a:	83 c4 2c             	add    $0x2c,%esp
8010068d:	5b                   	pop    %ebx
8010068e:	5e                   	pop    %esi
8010068f:	5f                   	pop    %edi
80100690:	5d                   	pop    %ebp
80100691:	c3                   	ret    
80100692:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100699:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801006a0 <cprintf>:
{
801006a0:	55                   	push   %ebp
801006a1:	89 e5                	mov    %esp,%ebp
801006a3:	57                   	push   %edi
801006a4:	56                   	push   %esi
801006a5:	53                   	push   %ebx
801006a6:	83 ec 1c             	sub    $0x1c,%esp
  locking = cons.locking;
801006a9:	a1 54 ff 10 80       	mov    0x8010ff54,%eax
801006ae:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(locking)
801006b1:	85 c0                	test   %eax,%eax
801006b3:	0f 85 27 01 00 00    	jne    801007e0 <cprintf+0x140>
  if (fmt == 0)
801006b9:	8b 75 08             	mov    0x8(%ebp),%esi
801006bc:	85 f6                	test   %esi,%esi
801006be:	0f 84 ac 01 00 00    	je     80100870 <cprintf+0x1d0>
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006c4:	0f b6 06             	movzbl (%esi),%eax
  argp = (uint*)(void*)(&fmt + 1);
801006c7:	8d 7d 0c             	lea    0xc(%ebp),%edi
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801006ca:	31 db                	xor    %ebx,%ebx
801006cc:	85 c0                	test   %eax,%eax
801006ce:	74 56                	je     80100726 <cprintf+0x86>
    if(c != '%'){
801006d0:	83 f8 25             	cmp    $0x25,%eax
801006d3:	0f 85 cf 00 00 00    	jne    801007a8 <cprintf+0x108>
    c = fmt[++i] & 0xff;
801006d9:	83 c3 01             	add    $0x1,%ebx
801006dc:	0f b6 14 1e          	movzbl (%esi,%ebx,1),%edx
    if(c == 0)
801006e0:	85 d2                	test   %edx,%edx
801006e2:	74 42                	je     80100726 <cprintf+0x86>
    switch(c){
801006e4:	83 fa 70             	cmp    $0x70,%edx
801006e7:	0f 84 90 00 00 00    	je     8010077d <cprintf+0xdd>
801006ed:	7f 51                	jg     80100740 <cprintf+0xa0>
801006ef:	83 fa 25             	cmp    $0x25,%edx
801006f2:	0f 84 c0 00 00 00    	je     801007b8 <cprintf+0x118>
801006f8:	83 fa 64             	cmp    $0x64,%edx
801006fb:	0f 85 f4 00 00 00    	jne    801007f5 <cprintf+0x155>
      printint(*argp++, 10, 1);
80100701:	8d 47 04             	lea    0x4(%edi),%eax
80100704:	b9 01 00 00 00       	mov    $0x1,%ecx
80100709:	ba 0a 00 00 00       	mov    $0xa,%edx
8010070e:	89 45 e0             	mov    %eax,-0x20(%ebp)
80100711:	8b 07                	mov    (%edi),%eax
80100713:	e8 e8 fe ff ff       	call   80100600 <printint>
80100718:	8b 7d e0             	mov    -0x20(%ebp),%edi
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
8010071b:	83 c3 01             	add    $0x1,%ebx
8010071e:	0f b6 04 1e          	movzbl (%esi,%ebx,1),%eax
80100722:	85 c0                	test   %eax,%eax
80100724:	75 aa                	jne    801006d0 <cprintf+0x30>
  if(locking)
80100726:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80100729:	85 c0                	test   %eax,%eax
8010072b:	0f 85 22 01 00 00    	jne    80100853 <cprintf+0x1b3>
}
80100731:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100734:	5b                   	pop    %ebx
80100735:	5e                   	pop    %esi
80100736:	5f                   	pop    %edi
80100737:	5d                   	pop    %ebp
80100738:	c3                   	ret    
80100739:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    switch(c){
80100740:	83 fa 73             	cmp    $0x73,%edx
80100743:	75 33                	jne    80100778 <cprintf+0xd8>
      if((s = (char*)*argp++) == 0)
80100745:	8d 47 04             	lea    0x4(%edi),%eax
80100748:	8b 3f                	mov    (%edi),%edi
8010074a:	89 45 e0             	mov    %eax,-0x20(%ebp)
8010074d:	85 ff                	test   %edi,%edi
8010074f:	0f 84 e3 00 00 00    	je     80100838 <cprintf+0x198>
      for(; *s; s++)
80100755:	0f be 07             	movsbl (%edi),%eax
80100758:	84 c0                	test   %al,%al
8010075a:	0f 84 08 01 00 00    	je     80100868 <cprintf+0x1c8>
  if(panicked){
80100760:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
80100766:	85 d2                	test   %edx,%edx
80100768:	0f 84 b2 00 00 00    	je     80100820 <cprintf+0x180>
8010076e:	fa                   	cli    
    for(;;)
8010076f:	eb fe                	jmp    8010076f <cprintf+0xcf>
80100771:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    switch(c){
80100778:	83 fa 78             	cmp    $0x78,%edx
8010077b:	75 78                	jne    801007f5 <cprintf+0x155>
      printint(*argp++, 16, 0);
8010077d:	8d 47 04             	lea    0x4(%edi),%eax
80100780:	31 c9                	xor    %ecx,%ecx
80100782:	ba 10 00 00 00       	mov    $0x10,%edx
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100787:	83 c3 01             	add    $0x1,%ebx
      printint(*argp++, 16, 0);
8010078a:	89 45 e0             	mov    %eax,-0x20(%ebp)
8010078d:	8b 07                	mov    (%edi),%eax
8010078f:	e8 6c fe ff ff       	call   80100600 <printint>
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
80100794:	0f b6 04 1e          	movzbl (%esi,%ebx,1),%eax
      printint(*argp++, 16, 0);
80100798:	8b 7d e0             	mov    -0x20(%ebp),%edi
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
8010079b:	85 c0                	test   %eax,%eax
8010079d:	0f 85 2d ff ff ff    	jne    801006d0 <cprintf+0x30>
801007a3:	eb 81                	jmp    80100726 <cprintf+0x86>
801007a5:	8d 76 00             	lea    0x0(%esi),%esi
  if(panicked){
801007a8:	8b 0d 58 ff 10 80    	mov    0x8010ff58,%ecx
801007ae:	85 c9                	test   %ecx,%ecx
801007b0:	74 14                	je     801007c6 <cprintf+0x126>
801007b2:	fa                   	cli    
    for(;;)
801007b3:	eb fe                	jmp    801007b3 <cprintf+0x113>
801007b5:	8d 76 00             	lea    0x0(%esi),%esi
  if(panicked){
801007b8:	a1 58 ff 10 80       	mov    0x8010ff58,%eax
801007bd:	85 c0                	test   %eax,%eax
801007bf:	75 6c                	jne    8010082d <cprintf+0x18d>
801007c1:	b8 25 00 00 00       	mov    $0x25,%eax
801007c6:	e8 35 fc ff ff       	call   80100400 <consputc.part.0>
  for(i = 0; (c = fmt[i] & 0xff) != 0; i++){
801007cb:	83 c3 01             	add    $0x1,%ebx
801007ce:	0f b6 04 1e          	movzbl (%esi,%ebx,1),%eax
801007d2:	85 c0                	test   %eax,%eax
801007d4:	0f 85 f6 fe ff ff    	jne    801006d0 <cprintf+0x30>
801007da:	e9 47 ff ff ff       	jmp    80100726 <cprintf+0x86>
801007df:	90                   	nop
    acquire(&cons.lock);
801007e0:	83 ec 0c             	sub    $0xc,%esp
801007e3:	68 20 ff 10 80       	push   $0x8010ff20
801007e8:	e8 b3 42 00 00       	call   80104aa0 <acquire>
801007ed:	83 c4 10             	add    $0x10,%esp
801007f0:	e9 c4 fe ff ff       	jmp    801006b9 <cprintf+0x19>
  if(panicked){
801007f5:	8b 0d 58 ff 10 80    	mov    0x8010ff58,%ecx
801007fb:	85 c9                	test   %ecx,%ecx
801007fd:	75 31                	jne    80100830 <cprintf+0x190>
801007ff:	b8 25 00 00 00       	mov    $0x25,%eax
80100804:	89 55 e0             	mov    %edx,-0x20(%ebp)
80100807:	e8 f4 fb ff ff       	call   80100400 <consputc.part.0>
8010080c:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
80100812:	85 d2                	test   %edx,%edx
80100814:	8b 55 e0             	mov    -0x20(%ebp),%edx
80100817:	74 2e                	je     80100847 <cprintf+0x1a7>
80100819:	fa                   	cli    
    for(;;)
8010081a:	eb fe                	jmp    8010081a <cprintf+0x17a>
8010081c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100820:	e8 db fb ff ff       	call   80100400 <consputc.part.0>
      for(; *s; s++)
80100825:	83 c7 01             	add    $0x1,%edi
80100828:	e9 28 ff ff ff       	jmp    80100755 <cprintf+0xb5>
8010082d:	fa                   	cli    
    for(;;)
8010082e:	eb fe                	jmp    8010082e <cprintf+0x18e>
80100830:	fa                   	cli    
80100831:	eb fe                	jmp    80100831 <cprintf+0x191>
80100833:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100837:	90                   	nop
        s = "(null)";
80100838:	bf 98 79 10 80       	mov    $0x80107998,%edi
      for(; *s; s++)
8010083d:	b8 28 00 00 00       	mov    $0x28,%eax
80100842:	e9 19 ff ff ff       	jmp    80100760 <cprintf+0xc0>
80100847:	89 d0                	mov    %edx,%eax
80100849:	e8 b2 fb ff ff       	call   80100400 <consputc.part.0>
8010084e:	e9 c8 fe ff ff       	jmp    8010071b <cprintf+0x7b>
    release(&cons.lock);
80100853:	83 ec 0c             	sub    $0xc,%esp
80100856:	68 20 ff 10 80       	push   $0x8010ff20
8010085b:	e8 60 43 00 00       	call   80104bc0 <release>
80100860:	83 c4 10             	add    $0x10,%esp
}
80100863:	e9 c9 fe ff ff       	jmp    80100731 <cprintf+0x91>
      if((s = (char*)*argp++) == 0)
80100868:	8b 7d e0             	mov    -0x20(%ebp),%edi
8010086b:	e9 ab fe ff ff       	jmp    8010071b <cprintf+0x7b>
    panic("null fmt");
80100870:	83 ec 0c             	sub    $0xc,%esp
80100873:	68 9f 79 10 80       	push   $0x8010799f
80100878:	e8 03 fb ff ff       	call   80100380 <panic>
8010087d:	8d 76 00             	lea    0x0(%esi),%esi

80100880 <consoleintr>:
{
80100880:	55                   	push   %ebp
80100881:	89 e5                	mov    %esp,%ebp
80100883:	57                   	push   %edi
80100884:	56                   	push   %esi
  int c, doprocdump = 0;
80100885:	31 f6                	xor    %esi,%esi
{
80100887:	53                   	push   %ebx
80100888:	83 ec 18             	sub    $0x18,%esp
8010088b:	8b 7d 08             	mov    0x8(%ebp),%edi
  acquire(&cons.lock);
8010088e:	68 20 ff 10 80       	push   $0x8010ff20
80100893:	e8 08 42 00 00       	call   80104aa0 <acquire>
  while((c = getc()) >= 0){
80100898:	83 c4 10             	add    $0x10,%esp
8010089b:	eb 1a                	jmp    801008b7 <consoleintr+0x37>
8010089d:	8d 76 00             	lea    0x0(%esi),%esi
    switch(c){
801008a0:	83 fb 08             	cmp    $0x8,%ebx
801008a3:	0f 84 d7 00 00 00    	je     80100980 <consoleintr+0x100>
801008a9:	83 fb 10             	cmp    $0x10,%ebx
801008ac:	0f 85 32 01 00 00    	jne    801009e4 <consoleintr+0x164>
801008b2:	be 01 00 00 00       	mov    $0x1,%esi
  while((c = getc()) >= 0){
801008b7:	ff d7                	call   *%edi
801008b9:	89 c3                	mov    %eax,%ebx
801008bb:	85 c0                	test   %eax,%eax
801008bd:	0f 88 05 01 00 00    	js     801009c8 <consoleintr+0x148>
    switch(c){
801008c3:	83 fb 15             	cmp    $0x15,%ebx
801008c6:	74 78                	je     80100940 <consoleintr+0xc0>
801008c8:	7e d6                	jle    801008a0 <consoleintr+0x20>
801008ca:	83 fb 7f             	cmp    $0x7f,%ebx
801008cd:	0f 84 ad 00 00 00    	je     80100980 <consoleintr+0x100>
      if(c != 0 && input.e-input.r < INPUT_BUF){
801008d3:	a1 08 ff 10 80       	mov    0x8010ff08,%eax
801008d8:	89 c2                	mov    %eax,%edx
801008da:	2b 15 00 ff 10 80    	sub    0x8010ff00,%edx
801008e0:	83 fa 7f             	cmp    $0x7f,%edx
801008e3:	77 d2                	ja     801008b7 <consoleintr+0x37>
        input.buf[input.e++ % INPUT_BUF] = c;
801008e5:	8d 48 01             	lea    0x1(%eax),%ecx
  if(panicked){
801008e8:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
        input.buf[input.e++ % INPUT_BUF] = c;
801008ee:	83 e0 7f             	and    $0x7f,%eax
801008f1:	89 0d 08 ff 10 80    	mov    %ecx,0x8010ff08
        c = (c == '\r') ? '\n' : c;
801008f7:	83 fb 0d             	cmp    $0xd,%ebx
801008fa:	0f 84 13 01 00 00    	je     80100a13 <consoleintr+0x193>
        input.buf[input.e++ % INPUT_BUF] = c;
80100900:	88 98 80 fe 10 80    	mov    %bl,-0x7fef0180(%eax)
  if(panicked){
80100906:	85 d2                	test   %edx,%edx
80100908:	0f 85 10 01 00 00    	jne    80100a1e <consoleintr+0x19e>
8010090e:	89 d8                	mov    %ebx,%eax
80100910:	e8 eb fa ff ff       	call   80100400 <consputc.part.0>
        if(c == '\n' || c == C('D') || input.e == input.r+INPUT_BUF){
80100915:	83 fb 0a             	cmp    $0xa,%ebx
80100918:	0f 84 14 01 00 00    	je     80100a32 <consoleintr+0x1b2>
8010091e:	83 fb 04             	cmp    $0x4,%ebx
80100921:	0f 84 0b 01 00 00    	je     80100a32 <consoleintr+0x1b2>
80100927:	a1 00 ff 10 80       	mov    0x8010ff00,%eax
8010092c:	83 e8 80             	sub    $0xffffff80,%eax
8010092f:	39 05 08 ff 10 80    	cmp    %eax,0x8010ff08
80100935:	75 80                	jne    801008b7 <consoleintr+0x37>
80100937:	e9 fb 00 00 00       	jmp    80100a37 <consoleintr+0x1b7>
8010093c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
      while(input.e != input.w &&
80100940:	a1 08 ff 10 80       	mov    0x8010ff08,%eax
80100945:	39 05 04 ff 10 80    	cmp    %eax,0x8010ff04
8010094b:	0f 84 66 ff ff ff    	je     801008b7 <consoleintr+0x37>
            input.buf[(input.e-1) % INPUT_BUF] != '\n'){
80100951:	83 e8 01             	sub    $0x1,%eax
80100954:	89 c2                	mov    %eax,%edx
80100956:	83 e2 7f             	and    $0x7f,%edx
      while(input.e != input.w &&
80100959:	80 ba 80 fe 10 80 0a 	cmpb   $0xa,-0x7fef0180(%edx)
80100960:	0f 84 51 ff ff ff    	je     801008b7 <consoleintr+0x37>
  if(panicked){
80100966:	8b 15 58 ff 10 80    	mov    0x8010ff58,%edx
        input.e--;
8010096c:	a3 08 ff 10 80       	mov    %eax,0x8010ff08
  if(panicked){
80100971:	85 d2                	test   %edx,%edx
80100973:	74 33                	je     801009a8 <consoleintr+0x128>
80100975:	fa                   	cli    
    for(;;)
80100976:	eb fe                	jmp    80100976 <consoleintr+0xf6>
80100978:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010097f:	90                   	nop
      if(input.e != input.w){
80100980:	a1 08 ff 10 80       	mov    0x8010ff08,%eax
80100985:	3b 05 04 ff 10 80    	cmp    0x8010ff04,%eax
8010098b:	0f 84 26 ff ff ff    	je     801008b7 <consoleintr+0x37>
        input.e--;
80100991:	83 e8 01             	sub    $0x1,%eax
80100994:	a3 08 ff 10 80       	mov    %eax,0x8010ff08
  if(panicked){
80100999:	a1 58 ff 10 80       	mov    0x8010ff58,%eax
8010099e:	85 c0                	test   %eax,%eax
801009a0:	74 56                	je     801009f8 <consoleintr+0x178>
801009a2:	fa                   	cli    
    for(;;)
801009a3:	eb fe                	jmp    801009a3 <consoleintr+0x123>
801009a5:	8d 76 00             	lea    0x0(%esi),%esi
801009a8:	b8 00 01 00 00       	mov    $0x100,%eax
801009ad:	e8 4e fa ff ff       	call   80100400 <consputc.part.0>
      while(input.e != input.w &&
801009b2:	a1 08 ff 10 80       	mov    0x8010ff08,%eax
801009b7:	3b 05 04 ff 10 80    	cmp    0x8010ff04,%eax
801009bd:	75 92                	jne    80100951 <consoleintr+0xd1>
801009bf:	e9 f3 fe ff ff       	jmp    801008b7 <consoleintr+0x37>
801009c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  release(&cons.lock);
801009c8:	83 ec 0c             	sub    $0xc,%esp
801009cb:	68 20 ff 10 80       	push   $0x8010ff20
801009d0:	e8 eb 41 00 00       	call   80104bc0 <release>
  if(doprocdump) {
801009d5:	83 c4 10             	add    $0x10,%esp
801009d8:	85 f6                	test   %esi,%esi
801009da:	75 2b                	jne    80100a07 <consoleintr+0x187>
}
801009dc:	8d 65 f4             	lea    -0xc(%ebp),%esp
801009df:	5b                   	pop    %ebx
801009e0:	5e                   	pop    %esi
801009e1:	5f                   	pop    %edi
801009e2:	5d                   	pop    %ebp
801009e3:	c3                   	ret    
      if(c != 0 && input.e-input.r < INPUT_BUF){
801009e4:	85 db                	test   %ebx,%ebx
801009e6:	0f 84 cb fe ff ff    	je     801008b7 <consoleintr+0x37>
801009ec:	e9 e2 fe ff ff       	jmp    801008d3 <consoleintr+0x53>
801009f1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801009f8:	b8 00 01 00 00       	mov    $0x100,%eax
801009fd:	e8 fe f9 ff ff       	call   80100400 <consputc.part.0>
80100a02:	e9 b0 fe ff ff       	jmp    801008b7 <consoleintr+0x37>
}
80100a07:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100a0a:	5b                   	pop    %ebx
80100a0b:	5e                   	pop    %esi
80100a0c:	5f                   	pop    %edi
80100a0d:	5d                   	pop    %ebp
    procdump();  // now call procdump() wo. cons.lock held
80100a0e:	e9 ad 3d 00 00       	jmp    801047c0 <procdump>
        input.buf[input.e++ % INPUT_BUF] = c;
80100a13:	c6 80 80 fe 10 80 0a 	movb   $0xa,-0x7fef0180(%eax)
  if(panicked){
80100a1a:	85 d2                	test   %edx,%edx
80100a1c:	74 0a                	je     80100a28 <consoleintr+0x1a8>
80100a1e:	fa                   	cli    
    for(;;)
80100a1f:	eb fe                	jmp    80100a1f <consoleintr+0x19f>
80100a21:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100a28:	b8 0a 00 00 00       	mov    $0xa,%eax
80100a2d:	e8 ce f9 ff ff       	call   80100400 <consputc.part.0>
          input.w = input.e;
80100a32:	a1 08 ff 10 80       	mov    0x8010ff08,%eax
          wakeup(&input.r);
80100a37:	83 ec 0c             	sub    $0xc,%esp
          input.w = input.e;
80100a3a:	a3 04 ff 10 80       	mov    %eax,0x8010ff04
          wakeup(&input.r);
80100a3f:	68 00 ff 10 80       	push   $0x8010ff00
80100a44:	e8 77 38 00 00       	call   801042c0 <wakeup>
80100a49:	83 c4 10             	add    $0x10,%esp
80100a4c:	e9 66 fe ff ff       	jmp    801008b7 <consoleintr+0x37>
80100a51:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100a58:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100a5f:	90                   	nop

80100a60 <consoleinit>:

void
consoleinit(void)
{
80100a60:	55                   	push   %ebp
80100a61:	89 e5                	mov    %esp,%ebp
80100a63:	83 ec 10             	sub    $0x10,%esp
  initlock(&cons.lock, "console");
80100a66:	68 a8 79 10 80       	push   $0x801079a8
80100a6b:	68 20 ff 10 80       	push   $0x8010ff20
80100a70:	e8 1b 3f 00 00       	call   80104990 <initlock>

  devsw[CONSOLE].write = consolewrite;
  devsw[CONSOLE].read = consoleread;
  cons.locking = 1;

  ioapicenable(IRQ_KBD, 0);
80100a75:	58                   	pop    %eax
80100a76:	5a                   	pop    %edx
80100a77:	6a 00                	push   $0x0
80100a79:	6a 01                	push   $0x1
  devsw[CONSOLE].write = consolewrite;
80100a7b:	c7 05 0c 09 11 80 90 	movl   $0x80100590,0x8011090c
80100a82:	05 10 80 
  devsw[CONSOLE].read = consoleread;
80100a85:	c7 05 08 09 11 80 80 	movl   $0x80100280,0x80110908
80100a8c:	02 10 80 
  cons.locking = 1;
80100a8f:	c7 05 54 ff 10 80 01 	movl   $0x1,0x8010ff54
80100a96:	00 00 00 
  ioapicenable(IRQ_KBD, 0);
80100a99:	e8 02 1a 00 00       	call   801024a0 <ioapicenable>
}
80100a9e:	83 c4 10             	add    $0x10,%esp
80100aa1:	c9                   	leave  
80100aa2:	c3                   	ret    
80100aa3:	66 90                	xchg   %ax,%ax
80100aa5:	66 90                	xchg   %ax,%ax
80100aa7:	66 90                	xchg   %ax,%ax
80100aa9:	66 90                	xchg   %ax,%ax
80100aab:	66 90                	xchg   %ax,%ax
80100aad:	66 90                	xchg   %ax,%ax
80100aaf:	90                   	nop

80100ab0 <exec>:
#include "x86.h"
#include "elf.h"

int
exec(char *path, char **argv)
{
80100ab0:	55                   	push   %ebp
80100ab1:	89 e5                	mov    %esp,%ebp
80100ab3:	57                   	push   %edi
80100ab4:	56                   	push   %esi
80100ab5:	53                   	push   %ebx
80100ab6:	81 ec 0c 01 00 00    	sub    $0x10c,%esp
  uint argc, sz, sp, ustack[3+MAXARG+1];
  struct elfhdr elf;
  struct inode *ip;
  struct proghdr ph;
  pde_t *pgdir, *oldpgdir;
  struct proc *curproc = myproc();
80100abc:	e8 df 2e 00 00       	call   801039a0 <myproc>
80100ac1:	89 85 ec fe ff ff    	mov    %eax,-0x114(%ebp)

  begin_op();
80100ac7:	e8 b4 22 00 00       	call   80102d80 <begin_op>

  if((ip = namei(path)) == 0){
80100acc:	83 ec 0c             	sub    $0xc,%esp
80100acf:	ff 75 08             	push   0x8(%ebp)
80100ad2:	e8 e9 15 00 00       	call   801020c0 <namei>
80100ad7:	83 c4 10             	add    $0x10,%esp
80100ada:	85 c0                	test   %eax,%eax
80100adc:	0f 84 02 03 00 00    	je     80100de4 <exec+0x334>
    end_op();
    cprintf("exec: fail\n");
    return -1;
  }
  ilock(ip);
80100ae2:	83 ec 0c             	sub    $0xc,%esp
80100ae5:	89 c3                	mov    %eax,%ebx
80100ae7:	50                   	push   %eax
80100ae8:	e8 b3 0c 00 00       	call   801017a0 <ilock>
  pgdir = 0;

  // Check ELF header
  if(readi(ip, (char*)&elf, 0, sizeof(elf)) != sizeof(elf))
80100aed:	8d 85 24 ff ff ff    	lea    -0xdc(%ebp),%eax
80100af3:	6a 34                	push   $0x34
80100af5:	6a 00                	push   $0x0
80100af7:	50                   	push   %eax
80100af8:	53                   	push   %ebx
80100af9:	e8 b2 0f 00 00       	call   80101ab0 <readi>
80100afe:	83 c4 20             	add    $0x20,%esp
80100b01:	83 f8 34             	cmp    $0x34,%eax
80100b04:	74 22                	je     80100b28 <exec+0x78>

 bad:
  if(pgdir)
    freevm(pgdir);
  if(ip){
    iunlockput(ip);
80100b06:	83 ec 0c             	sub    $0xc,%esp
80100b09:	53                   	push   %ebx
80100b0a:	e8 21 0f 00 00       	call   80101a30 <iunlockput>
    end_op();
80100b0f:	e8 dc 22 00 00       	call   80102df0 <end_op>
80100b14:	83 c4 10             	add    $0x10,%esp
  }
  return -1;
80100b17:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80100b1c:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100b1f:	5b                   	pop    %ebx
80100b20:	5e                   	pop    %esi
80100b21:	5f                   	pop    %edi
80100b22:	5d                   	pop    %ebp
80100b23:	c3                   	ret    
80100b24:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  if(elf.magic != ELF_MAGIC)
80100b28:	81 bd 24 ff ff ff 7f 	cmpl   $0x464c457f,-0xdc(%ebp)
80100b2f:	45 4c 46 
80100b32:	75 d2                	jne    80100b06 <exec+0x56>
  if((pgdir = setupkvm()) == 0)
80100b34:	e8 c7 6a 00 00       	call   80107600 <setupkvm>
80100b39:	89 85 f4 fe ff ff    	mov    %eax,-0x10c(%ebp)
80100b3f:	85 c0                	test   %eax,%eax
80100b41:	74 c3                	je     80100b06 <exec+0x56>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100b43:	66 83 bd 50 ff ff ff 	cmpw   $0x0,-0xb0(%ebp)
80100b4a:	00 
80100b4b:	8b b5 40 ff ff ff    	mov    -0xc0(%ebp),%esi
80100b51:	0f 84 ac 02 00 00    	je     80100e03 <exec+0x353>
  sz = 0;
80100b57:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
80100b5e:	00 00 00 
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100b61:	31 ff                	xor    %edi,%edi
80100b63:	e9 8e 00 00 00       	jmp    80100bf6 <exec+0x146>
80100b68:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100b6f:	90                   	nop
    if(ph.type != ELF_PROG_LOAD)
80100b70:	83 bd 04 ff ff ff 01 	cmpl   $0x1,-0xfc(%ebp)
80100b77:	75 6c                	jne    80100be5 <exec+0x135>
    if(ph.memsz < ph.filesz)
80100b79:	8b 85 18 ff ff ff    	mov    -0xe8(%ebp),%eax
80100b7f:	3b 85 14 ff ff ff    	cmp    -0xec(%ebp),%eax
80100b85:	0f 82 87 00 00 00    	jb     80100c12 <exec+0x162>
    if(ph.vaddr + ph.memsz < ph.vaddr)
80100b8b:	03 85 0c ff ff ff    	add    -0xf4(%ebp),%eax
80100b91:	72 7f                	jb     80100c12 <exec+0x162>
    if((sz = allocuvm(pgdir, sz, ph.vaddr + ph.memsz)) == 0)
80100b93:	83 ec 04             	sub    $0x4,%esp
80100b96:	50                   	push   %eax
80100b97:	ff b5 f0 fe ff ff    	push   -0x110(%ebp)
80100b9d:	ff b5 f4 fe ff ff    	push   -0x10c(%ebp)
80100ba3:	e8 78 68 00 00       	call   80107420 <allocuvm>
80100ba8:	83 c4 10             	add    $0x10,%esp
80100bab:	89 85 f0 fe ff ff    	mov    %eax,-0x110(%ebp)
80100bb1:	85 c0                	test   %eax,%eax
80100bb3:	74 5d                	je     80100c12 <exec+0x162>
    if(ph.vaddr % PGSIZE != 0)
80100bb5:	8b 85 0c ff ff ff    	mov    -0xf4(%ebp),%eax
80100bbb:	a9 ff 0f 00 00       	test   $0xfff,%eax
80100bc0:	75 50                	jne    80100c12 <exec+0x162>
    if(loaduvm(pgdir, (char*)ph.vaddr, ip, ph.off, ph.filesz) < 0)
80100bc2:	83 ec 0c             	sub    $0xc,%esp
80100bc5:	ff b5 14 ff ff ff    	push   -0xec(%ebp)
80100bcb:	ff b5 08 ff ff ff    	push   -0xf8(%ebp)
80100bd1:	53                   	push   %ebx
80100bd2:	50                   	push   %eax
80100bd3:	ff b5 f4 fe ff ff    	push   -0x10c(%ebp)
80100bd9:	e8 52 67 00 00       	call   80107330 <loaduvm>
80100bde:	83 c4 20             	add    $0x20,%esp
80100be1:	85 c0                	test   %eax,%eax
80100be3:	78 2d                	js     80100c12 <exec+0x162>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100be5:	0f b7 85 50 ff ff ff 	movzwl -0xb0(%ebp),%eax
80100bec:	83 c7 01             	add    $0x1,%edi
80100bef:	83 c6 20             	add    $0x20,%esi
80100bf2:	39 f8                	cmp    %edi,%eax
80100bf4:	7e 3a                	jle    80100c30 <exec+0x180>
    if(readi(ip, (char*)&ph, off, sizeof(ph)) != sizeof(ph))
80100bf6:	8d 85 04 ff ff ff    	lea    -0xfc(%ebp),%eax
80100bfc:	6a 20                	push   $0x20
80100bfe:	56                   	push   %esi
80100bff:	50                   	push   %eax
80100c00:	53                   	push   %ebx
80100c01:	e8 aa 0e 00 00       	call   80101ab0 <readi>
80100c06:	83 c4 10             	add    $0x10,%esp
80100c09:	83 f8 20             	cmp    $0x20,%eax
80100c0c:	0f 84 5e ff ff ff    	je     80100b70 <exec+0xc0>
    freevm(pgdir);
80100c12:	83 ec 0c             	sub    $0xc,%esp
80100c15:	ff b5 f4 fe ff ff    	push   -0x10c(%ebp)
80100c1b:	e8 60 69 00 00       	call   80107580 <freevm>
  if(ip){
80100c20:	83 c4 10             	add    $0x10,%esp
80100c23:	e9 de fe ff ff       	jmp    80100b06 <exec+0x56>
80100c28:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100c2f:	90                   	nop
  sz = PGROUNDUP(sz);
80100c30:	8b bd f0 fe ff ff    	mov    -0x110(%ebp),%edi
80100c36:	81 c7 ff 0f 00 00    	add    $0xfff,%edi
80100c3c:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
  if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100c42:	8d b7 00 20 00 00    	lea    0x2000(%edi),%esi
  iunlockput(ip);
80100c48:	83 ec 0c             	sub    $0xc,%esp
80100c4b:	53                   	push   %ebx
80100c4c:	e8 df 0d 00 00       	call   80101a30 <iunlockput>
  end_op();
80100c51:	e8 9a 21 00 00       	call   80102df0 <end_op>
  if((sz = allocuvm(pgdir, sz, sz + 2*PGSIZE)) == 0)
80100c56:	83 c4 0c             	add    $0xc,%esp
80100c59:	56                   	push   %esi
80100c5a:	57                   	push   %edi
80100c5b:	8b bd f4 fe ff ff    	mov    -0x10c(%ebp),%edi
80100c61:	57                   	push   %edi
80100c62:	e8 b9 67 00 00       	call   80107420 <allocuvm>
80100c67:	83 c4 10             	add    $0x10,%esp
80100c6a:	89 c6                	mov    %eax,%esi
80100c6c:	85 c0                	test   %eax,%eax
80100c6e:	0f 84 94 00 00 00    	je     80100d08 <exec+0x258>
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100c74:	83 ec 08             	sub    $0x8,%esp
80100c77:	8d 80 00 e0 ff ff    	lea    -0x2000(%eax),%eax
  for(argc = 0; argv[argc]; argc++) {
80100c7d:	89 f3                	mov    %esi,%ebx
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100c7f:	50                   	push   %eax
80100c80:	57                   	push   %edi
  for(argc = 0; argv[argc]; argc++) {
80100c81:	31 ff                	xor    %edi,%edi
  clearpteu(pgdir, (char*)(sz - 2*PGSIZE));
80100c83:	e8 18 6a 00 00       	call   801076a0 <clearpteu>
  for(argc = 0; argv[argc]; argc++) {
80100c88:	8b 45 0c             	mov    0xc(%ebp),%eax
80100c8b:	83 c4 10             	add    $0x10,%esp
80100c8e:	8d 95 58 ff ff ff    	lea    -0xa8(%ebp),%edx
80100c94:	8b 00                	mov    (%eax),%eax
80100c96:	85 c0                	test   %eax,%eax
80100c98:	0f 84 8b 00 00 00    	je     80100d29 <exec+0x279>
80100c9e:	89 b5 f0 fe ff ff    	mov    %esi,-0x110(%ebp)
80100ca4:	8b b5 f4 fe ff ff    	mov    -0x10c(%ebp),%esi
80100caa:	eb 23                	jmp    80100ccf <exec+0x21f>
80100cac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100cb0:	8b 45 0c             	mov    0xc(%ebp),%eax
    ustack[3+argc] = sp;
80100cb3:	89 9c bd 64 ff ff ff 	mov    %ebx,-0x9c(%ebp,%edi,4)
  for(argc = 0; argv[argc]; argc++) {
80100cba:	83 c7 01             	add    $0x1,%edi
    ustack[3+argc] = sp;
80100cbd:	8d 95 58 ff ff ff    	lea    -0xa8(%ebp),%edx
  for(argc = 0; argv[argc]; argc++) {
80100cc3:	8b 04 b8             	mov    (%eax,%edi,4),%eax
80100cc6:	85 c0                	test   %eax,%eax
80100cc8:	74 59                	je     80100d23 <exec+0x273>
    if(argc >= MAXARG)
80100cca:	83 ff 20             	cmp    $0x20,%edi
80100ccd:	74 39                	je     80100d08 <exec+0x258>
    sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100ccf:	83 ec 0c             	sub    $0xc,%esp
80100cd2:	50                   	push   %eax
80100cd3:	e8 38 41 00 00       	call   80104e10 <strlen>
80100cd8:	29 c3                	sub    %eax,%ebx
    if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100cda:	58                   	pop    %eax
80100cdb:	8b 45 0c             	mov    0xc(%ebp),%eax
    sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100cde:	83 eb 01             	sub    $0x1,%ebx
    if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100ce1:	ff 34 b8             	push   (%eax,%edi,4)
    sp = (sp - (strlen(argv[argc]) + 1)) & ~3;
80100ce4:	83 e3 fc             	and    $0xfffffffc,%ebx
    if(copyout(pgdir, sp, argv[argc], strlen(argv[argc]) + 1) < 0)
80100ce7:	e8 24 41 00 00       	call   80104e10 <strlen>
80100cec:	83 c0 01             	add    $0x1,%eax
80100cef:	50                   	push   %eax
80100cf0:	8b 45 0c             	mov    0xc(%ebp),%eax
80100cf3:	ff 34 b8             	push   (%eax,%edi,4)
80100cf6:	53                   	push   %ebx
80100cf7:	56                   	push   %esi
80100cf8:	e8 63 6b 00 00       	call   80107860 <copyout>
80100cfd:	83 c4 20             	add    $0x20,%esp
80100d00:	85 c0                	test   %eax,%eax
80100d02:	79 ac                	jns    80100cb0 <exec+0x200>
80100d04:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    freevm(pgdir);
80100d08:	83 ec 0c             	sub    $0xc,%esp
80100d0b:	ff b5 f4 fe ff ff    	push   -0x10c(%ebp)
80100d11:	e8 6a 68 00 00       	call   80107580 <freevm>
80100d16:	83 c4 10             	add    $0x10,%esp
  return -1;
80100d19:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80100d1e:	e9 f9 fd ff ff       	jmp    80100b1c <exec+0x6c>
80100d23:	8b b5 f0 fe ff ff    	mov    -0x110(%ebp),%esi
  ustack[2] = sp - (argc+1)*4;  // argv pointer
80100d29:	8d 04 bd 04 00 00 00 	lea    0x4(,%edi,4),%eax
80100d30:	89 d9                	mov    %ebx,%ecx
  ustack[3+argc] = 0;
80100d32:	c7 84 bd 64 ff ff ff 	movl   $0x0,-0x9c(%ebp,%edi,4)
80100d39:	00 00 00 00 
  ustack[2] = sp - (argc+1)*4;  // argv pointer
80100d3d:	29 c1                	sub    %eax,%ecx
  sp -= (3+argc+1) * 4;
80100d3f:	83 c0 0c             	add    $0xc,%eax
  ustack[1] = argc;
80100d42:	89 bd 5c ff ff ff    	mov    %edi,-0xa4(%ebp)
  sp -= (3+argc+1) * 4;
80100d48:	29 c3                	sub    %eax,%ebx
  if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100d4a:	50                   	push   %eax
80100d4b:	52                   	push   %edx
80100d4c:	53                   	push   %ebx
80100d4d:	ff b5 f4 fe ff ff    	push   -0x10c(%ebp)
  ustack[0] = 0xffffffff;  // fake return PC
80100d53:	c7 85 58 ff ff ff ff 	movl   $0xffffffff,-0xa8(%ebp)
80100d5a:	ff ff ff 
  ustack[2] = sp - (argc+1)*4;  // argv pointer
80100d5d:	89 8d 60 ff ff ff    	mov    %ecx,-0xa0(%ebp)
  if(copyout(pgdir, sp, ustack, (3+argc+1)*4) < 0)
80100d63:	e8 f8 6a 00 00       	call   80107860 <copyout>
80100d68:	83 c4 10             	add    $0x10,%esp
80100d6b:	85 c0                	test   %eax,%eax
80100d6d:	78 99                	js     80100d08 <exec+0x258>
  for(last=s=path; *s; s++)
80100d6f:	8b 45 08             	mov    0x8(%ebp),%eax
80100d72:	8b 55 08             	mov    0x8(%ebp),%edx
80100d75:	0f b6 00             	movzbl (%eax),%eax
80100d78:	84 c0                	test   %al,%al
80100d7a:	74 13                	je     80100d8f <exec+0x2df>
80100d7c:	89 d1                	mov    %edx,%ecx
80100d7e:	66 90                	xchg   %ax,%ax
      last = s+1;
80100d80:	83 c1 01             	add    $0x1,%ecx
80100d83:	3c 2f                	cmp    $0x2f,%al
  for(last=s=path; *s; s++)
80100d85:	0f b6 01             	movzbl (%ecx),%eax
      last = s+1;
80100d88:	0f 44 d1             	cmove  %ecx,%edx
  for(last=s=path; *s; s++)
80100d8b:	84 c0                	test   %al,%al
80100d8d:	75 f1                	jne    80100d80 <exec+0x2d0>
  safestrcpy(curproc->name, last, sizeof(curproc->name));
80100d8f:	8b bd ec fe ff ff    	mov    -0x114(%ebp),%edi
80100d95:	83 ec 04             	sub    $0x4,%esp
80100d98:	6a 10                	push   $0x10
80100d9a:	89 f8                	mov    %edi,%eax
80100d9c:	52                   	push   %edx
80100d9d:	83 c0 6c             	add    $0x6c,%eax
80100da0:	50                   	push   %eax
80100da1:	e8 2a 40 00 00       	call   80104dd0 <safestrcpy>
  curproc->pgdir = pgdir;
80100da6:	8b 8d f4 fe ff ff    	mov    -0x10c(%ebp),%ecx
  oldpgdir = curproc->pgdir;
80100dac:	89 f8                	mov    %edi,%eax
80100dae:	8b 7f 04             	mov    0x4(%edi),%edi
  curproc->sz = sz;
80100db1:	89 30                	mov    %esi,(%eax)
  curproc->pgdir = pgdir;
80100db3:	89 48 04             	mov    %ecx,0x4(%eax)
  curproc->tf->eip = elf.entry;  // main
80100db6:	89 c1                	mov    %eax,%ecx
80100db8:	8b 95 3c ff ff ff    	mov    -0xc4(%ebp),%edx
80100dbe:	8b 40 18             	mov    0x18(%eax),%eax
80100dc1:	89 50 38             	mov    %edx,0x38(%eax)
  curproc->tf->esp = sp;
80100dc4:	8b 41 18             	mov    0x18(%ecx),%eax
80100dc7:	89 58 44             	mov    %ebx,0x44(%eax)
  switchuvm(curproc);
80100dca:	89 0c 24             	mov    %ecx,(%esp)
80100dcd:	e8 ce 63 00 00       	call   801071a0 <switchuvm>
  freevm(oldpgdir);
80100dd2:	89 3c 24             	mov    %edi,(%esp)
80100dd5:	e8 a6 67 00 00       	call   80107580 <freevm>
  return 0;
80100dda:	83 c4 10             	add    $0x10,%esp
80100ddd:	31 c0                	xor    %eax,%eax
80100ddf:	e9 38 fd ff ff       	jmp    80100b1c <exec+0x6c>
    end_op();
80100de4:	e8 07 20 00 00       	call   80102df0 <end_op>
    cprintf("exec: fail\n");
80100de9:	83 ec 0c             	sub    $0xc,%esp
80100dec:	68 c1 79 10 80       	push   $0x801079c1
80100df1:	e8 aa f8 ff ff       	call   801006a0 <cprintf>
    return -1;
80100df6:	83 c4 10             	add    $0x10,%esp
80100df9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80100dfe:	e9 19 fd ff ff       	jmp    80100b1c <exec+0x6c>
  for(i=0, off=elf.phoff; i<elf.phnum; i++, off+=sizeof(ph)){
80100e03:	be 00 20 00 00       	mov    $0x2000,%esi
80100e08:	31 ff                	xor    %edi,%edi
80100e0a:	e9 39 fe ff ff       	jmp    80100c48 <exec+0x198>
80100e0f:	90                   	nop

80100e10 <fileinit>:
  struct file file[NFILE];
} ftable;

void
fileinit(void)
{
80100e10:	55                   	push   %ebp
80100e11:	89 e5                	mov    %esp,%ebp
80100e13:	83 ec 10             	sub    $0x10,%esp
  initlock(&ftable.lock, "ftable");
80100e16:	68 cd 79 10 80       	push   $0x801079cd
80100e1b:	68 60 ff 10 80       	push   $0x8010ff60
80100e20:	e8 6b 3b 00 00       	call   80104990 <initlock>
}
80100e25:	83 c4 10             	add    $0x10,%esp
80100e28:	c9                   	leave  
80100e29:	c3                   	ret    
80100e2a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80100e30 <filealloc>:

// Allocate a file structure.
struct file*
filealloc(void)
{
80100e30:	55                   	push   %ebp
80100e31:	89 e5                	mov    %esp,%ebp
80100e33:	53                   	push   %ebx
  struct file *f;

  acquire(&ftable.lock);
  for(f = ftable.file; f < ftable.file + NFILE; f++){
80100e34:	bb 94 ff 10 80       	mov    $0x8010ff94,%ebx
{
80100e39:	83 ec 10             	sub    $0x10,%esp
  acquire(&ftable.lock);
80100e3c:	68 60 ff 10 80       	push   $0x8010ff60
80100e41:	e8 5a 3c 00 00       	call   80104aa0 <acquire>
80100e46:	83 c4 10             	add    $0x10,%esp
80100e49:	eb 10                	jmp    80100e5b <filealloc+0x2b>
80100e4b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100e4f:	90                   	nop
  for(f = ftable.file; f < ftable.file + NFILE; f++){
80100e50:	83 c3 18             	add    $0x18,%ebx
80100e53:	81 fb f4 08 11 80    	cmp    $0x801108f4,%ebx
80100e59:	74 25                	je     80100e80 <filealloc+0x50>
    if(f->ref == 0){
80100e5b:	8b 43 04             	mov    0x4(%ebx),%eax
80100e5e:	85 c0                	test   %eax,%eax
80100e60:	75 ee                	jne    80100e50 <filealloc+0x20>
      f->ref = 1;
      release(&ftable.lock);
80100e62:	83 ec 0c             	sub    $0xc,%esp
      f->ref = 1;
80100e65:	c7 43 04 01 00 00 00 	movl   $0x1,0x4(%ebx)
      release(&ftable.lock);
80100e6c:	68 60 ff 10 80       	push   $0x8010ff60
80100e71:	e8 4a 3d 00 00       	call   80104bc0 <release>
      return f;
    }
  }
  release(&ftable.lock);
  return 0;
}
80100e76:	89 d8                	mov    %ebx,%eax
      return f;
80100e78:	83 c4 10             	add    $0x10,%esp
}
80100e7b:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100e7e:	c9                   	leave  
80100e7f:	c3                   	ret    
  release(&ftable.lock);
80100e80:	83 ec 0c             	sub    $0xc,%esp
  return 0;
80100e83:	31 db                	xor    %ebx,%ebx
  release(&ftable.lock);
80100e85:	68 60 ff 10 80       	push   $0x8010ff60
80100e8a:	e8 31 3d 00 00       	call   80104bc0 <release>
}
80100e8f:	89 d8                	mov    %ebx,%eax
  return 0;
80100e91:	83 c4 10             	add    $0x10,%esp
}
80100e94:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100e97:	c9                   	leave  
80100e98:	c3                   	ret    
80100e99:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80100ea0 <filedup>:

// Increment ref count for file f.
struct file*
filedup(struct file *f)
{
80100ea0:	55                   	push   %ebp
80100ea1:	89 e5                	mov    %esp,%ebp
80100ea3:	53                   	push   %ebx
80100ea4:	83 ec 10             	sub    $0x10,%esp
80100ea7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&ftable.lock);
80100eaa:	68 60 ff 10 80       	push   $0x8010ff60
80100eaf:	e8 ec 3b 00 00       	call   80104aa0 <acquire>
  if(f->ref < 1)
80100eb4:	8b 43 04             	mov    0x4(%ebx),%eax
80100eb7:	83 c4 10             	add    $0x10,%esp
80100eba:	85 c0                	test   %eax,%eax
80100ebc:	7e 1a                	jle    80100ed8 <filedup+0x38>
    panic("filedup");
  f->ref++;
80100ebe:	83 c0 01             	add    $0x1,%eax
  release(&ftable.lock);
80100ec1:	83 ec 0c             	sub    $0xc,%esp
  f->ref++;
80100ec4:	89 43 04             	mov    %eax,0x4(%ebx)
  release(&ftable.lock);
80100ec7:	68 60 ff 10 80       	push   $0x8010ff60
80100ecc:	e8 ef 3c 00 00       	call   80104bc0 <release>
  return f;
}
80100ed1:	89 d8                	mov    %ebx,%eax
80100ed3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80100ed6:	c9                   	leave  
80100ed7:	c3                   	ret    
    panic("filedup");
80100ed8:	83 ec 0c             	sub    $0xc,%esp
80100edb:	68 d4 79 10 80       	push   $0x801079d4
80100ee0:	e8 9b f4 ff ff       	call   80100380 <panic>
80100ee5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100eec:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80100ef0 <fileclose>:

// Close file f.  (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *f)
{
80100ef0:	55                   	push   %ebp
80100ef1:	89 e5                	mov    %esp,%ebp
80100ef3:	57                   	push   %edi
80100ef4:	56                   	push   %esi
80100ef5:	53                   	push   %ebx
80100ef6:	83 ec 28             	sub    $0x28,%esp
80100ef9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct file ff;

  acquire(&ftable.lock);
80100efc:	68 60 ff 10 80       	push   $0x8010ff60
80100f01:	e8 9a 3b 00 00       	call   80104aa0 <acquire>
  if(f->ref < 1)
80100f06:	8b 53 04             	mov    0x4(%ebx),%edx
80100f09:	83 c4 10             	add    $0x10,%esp
80100f0c:	85 d2                	test   %edx,%edx
80100f0e:	0f 8e a5 00 00 00    	jle    80100fb9 <fileclose+0xc9>
    panic("fileclose");
  if(--f->ref > 0){
80100f14:	83 ea 01             	sub    $0x1,%edx
80100f17:	89 53 04             	mov    %edx,0x4(%ebx)
80100f1a:	75 44                	jne    80100f60 <fileclose+0x70>
    release(&ftable.lock);
    return;
  }
  ff = *f;
80100f1c:	0f b6 43 09          	movzbl 0x9(%ebx),%eax
  f->ref = 0;
  f->type = FD_NONE;
  release(&ftable.lock);
80100f20:	83 ec 0c             	sub    $0xc,%esp
  ff = *f;
80100f23:	8b 3b                	mov    (%ebx),%edi
  f->type = FD_NONE;
80100f25:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  ff = *f;
80100f2b:	8b 73 0c             	mov    0xc(%ebx),%esi
80100f2e:	88 45 e7             	mov    %al,-0x19(%ebp)
80100f31:	8b 43 10             	mov    0x10(%ebx),%eax
  release(&ftable.lock);
80100f34:	68 60 ff 10 80       	push   $0x8010ff60
  ff = *f;
80100f39:	89 45 e0             	mov    %eax,-0x20(%ebp)
  release(&ftable.lock);
80100f3c:	e8 7f 3c 00 00       	call   80104bc0 <release>

  if(ff.type == FD_PIPE)
80100f41:	83 c4 10             	add    $0x10,%esp
80100f44:	83 ff 01             	cmp    $0x1,%edi
80100f47:	74 57                	je     80100fa0 <fileclose+0xb0>
    pipeclose(ff.pipe, ff.writable);
  else if(ff.type == FD_INODE){
80100f49:	83 ff 02             	cmp    $0x2,%edi
80100f4c:	74 2a                	je     80100f78 <fileclose+0x88>
    begin_op();
    iput(ff.ip);
    end_op();
  }
}
80100f4e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100f51:	5b                   	pop    %ebx
80100f52:	5e                   	pop    %esi
80100f53:	5f                   	pop    %edi
80100f54:	5d                   	pop    %ebp
80100f55:	c3                   	ret    
80100f56:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100f5d:	8d 76 00             	lea    0x0(%esi),%esi
    release(&ftable.lock);
80100f60:	c7 45 08 60 ff 10 80 	movl   $0x8010ff60,0x8(%ebp)
}
80100f67:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100f6a:	5b                   	pop    %ebx
80100f6b:	5e                   	pop    %esi
80100f6c:	5f                   	pop    %edi
80100f6d:	5d                   	pop    %ebp
    release(&ftable.lock);
80100f6e:	e9 4d 3c 00 00       	jmp    80104bc0 <release>
80100f73:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80100f77:	90                   	nop
    begin_op();
80100f78:	e8 03 1e 00 00       	call   80102d80 <begin_op>
    iput(ff.ip);
80100f7d:	83 ec 0c             	sub    $0xc,%esp
80100f80:	ff 75 e0             	push   -0x20(%ebp)
80100f83:	e8 48 09 00 00       	call   801018d0 <iput>
    end_op();
80100f88:	83 c4 10             	add    $0x10,%esp
}
80100f8b:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100f8e:	5b                   	pop    %ebx
80100f8f:	5e                   	pop    %esi
80100f90:	5f                   	pop    %edi
80100f91:	5d                   	pop    %ebp
    end_op();
80100f92:	e9 59 1e 00 00       	jmp    80102df0 <end_op>
80100f97:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100f9e:	66 90                	xchg   %ax,%ax
    pipeclose(ff.pipe, ff.writable);
80100fa0:	0f be 5d e7          	movsbl -0x19(%ebp),%ebx
80100fa4:	83 ec 08             	sub    $0x8,%esp
80100fa7:	53                   	push   %ebx
80100fa8:	56                   	push   %esi
80100fa9:	e8 a2 25 00 00       	call   80103550 <pipeclose>
80100fae:	83 c4 10             	add    $0x10,%esp
}
80100fb1:	8d 65 f4             	lea    -0xc(%ebp),%esp
80100fb4:	5b                   	pop    %ebx
80100fb5:	5e                   	pop    %esi
80100fb6:	5f                   	pop    %edi
80100fb7:	5d                   	pop    %ebp
80100fb8:	c3                   	ret    
    panic("fileclose");
80100fb9:	83 ec 0c             	sub    $0xc,%esp
80100fbc:	68 dc 79 10 80       	push   $0x801079dc
80100fc1:	e8 ba f3 ff ff       	call   80100380 <panic>
80100fc6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80100fcd:	8d 76 00             	lea    0x0(%esi),%esi

80100fd0 <filestat>:

// Get metadata about file f.
int
filestat(struct file *f, struct stat *st)
{
80100fd0:	55                   	push   %ebp
80100fd1:	89 e5                	mov    %esp,%ebp
80100fd3:	53                   	push   %ebx
80100fd4:	83 ec 04             	sub    $0x4,%esp
80100fd7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(f->type == FD_INODE){
80100fda:	83 3b 02             	cmpl   $0x2,(%ebx)
80100fdd:	75 31                	jne    80101010 <filestat+0x40>
    ilock(f->ip);
80100fdf:	83 ec 0c             	sub    $0xc,%esp
80100fe2:	ff 73 10             	push   0x10(%ebx)
80100fe5:	e8 b6 07 00 00       	call   801017a0 <ilock>
    stati(f->ip, st);
80100fea:	58                   	pop    %eax
80100feb:	5a                   	pop    %edx
80100fec:	ff 75 0c             	push   0xc(%ebp)
80100fef:	ff 73 10             	push   0x10(%ebx)
80100ff2:	e8 89 0a 00 00       	call   80101a80 <stati>
    iunlock(f->ip);
80100ff7:	59                   	pop    %ecx
80100ff8:	ff 73 10             	push   0x10(%ebx)
80100ffb:	e8 80 08 00 00       	call   80101880 <iunlock>
    return 0;
  }
  return -1;
}
80101000:	8b 5d fc             	mov    -0x4(%ebp),%ebx
    return 0;
80101003:	83 c4 10             	add    $0x10,%esp
80101006:	31 c0                	xor    %eax,%eax
}
80101008:	c9                   	leave  
80101009:	c3                   	ret    
8010100a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80101010:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  return -1;
80101013:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80101018:	c9                   	leave  
80101019:	c3                   	ret    
8010101a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101020 <fileread>:

// Read from file f.
int
fileread(struct file *f, char *addr, int n)
{
80101020:	55                   	push   %ebp
80101021:	89 e5                	mov    %esp,%ebp
80101023:	57                   	push   %edi
80101024:	56                   	push   %esi
80101025:	53                   	push   %ebx
80101026:	83 ec 0c             	sub    $0xc,%esp
80101029:	8b 5d 08             	mov    0x8(%ebp),%ebx
8010102c:	8b 75 0c             	mov    0xc(%ebp),%esi
8010102f:	8b 7d 10             	mov    0x10(%ebp),%edi
  int r;

  if(f->readable == 0)
80101032:	80 7b 08 00          	cmpb   $0x0,0x8(%ebx)
80101036:	74 60                	je     80101098 <fileread+0x78>
    return -1;
  if(f->type == FD_PIPE)
80101038:	8b 03                	mov    (%ebx),%eax
8010103a:	83 f8 01             	cmp    $0x1,%eax
8010103d:	74 41                	je     80101080 <fileread+0x60>
    return piperead(f->pipe, addr, n);
  if(f->type == FD_INODE){
8010103f:	83 f8 02             	cmp    $0x2,%eax
80101042:	75 5b                	jne    8010109f <fileread+0x7f>
    ilock(f->ip);
80101044:	83 ec 0c             	sub    $0xc,%esp
80101047:	ff 73 10             	push   0x10(%ebx)
8010104a:	e8 51 07 00 00       	call   801017a0 <ilock>
    if((r = readi(f->ip, addr, f->off, n)) > 0)
8010104f:	57                   	push   %edi
80101050:	ff 73 14             	push   0x14(%ebx)
80101053:	56                   	push   %esi
80101054:	ff 73 10             	push   0x10(%ebx)
80101057:	e8 54 0a 00 00       	call   80101ab0 <readi>
8010105c:	83 c4 20             	add    $0x20,%esp
8010105f:	89 c6                	mov    %eax,%esi
80101061:	85 c0                	test   %eax,%eax
80101063:	7e 03                	jle    80101068 <fileread+0x48>
      f->off += r;
80101065:	01 43 14             	add    %eax,0x14(%ebx)
    iunlock(f->ip);
80101068:	83 ec 0c             	sub    $0xc,%esp
8010106b:	ff 73 10             	push   0x10(%ebx)
8010106e:	e8 0d 08 00 00       	call   80101880 <iunlock>
    return r;
80101073:	83 c4 10             	add    $0x10,%esp
  }
  panic("fileread");
}
80101076:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101079:	89 f0                	mov    %esi,%eax
8010107b:	5b                   	pop    %ebx
8010107c:	5e                   	pop    %esi
8010107d:	5f                   	pop    %edi
8010107e:	5d                   	pop    %ebp
8010107f:	c3                   	ret    
    return piperead(f->pipe, addr, n);
80101080:	8b 43 0c             	mov    0xc(%ebx),%eax
80101083:	89 45 08             	mov    %eax,0x8(%ebp)
}
80101086:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101089:	5b                   	pop    %ebx
8010108a:	5e                   	pop    %esi
8010108b:	5f                   	pop    %edi
8010108c:	5d                   	pop    %ebp
    return piperead(f->pipe, addr, n);
8010108d:	e9 5e 26 00 00       	jmp    801036f0 <piperead>
80101092:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    return -1;
80101098:	be ff ff ff ff       	mov    $0xffffffff,%esi
8010109d:	eb d7                	jmp    80101076 <fileread+0x56>
  panic("fileread");
8010109f:	83 ec 0c             	sub    $0xc,%esp
801010a2:	68 e6 79 10 80       	push   $0x801079e6
801010a7:	e8 d4 f2 ff ff       	call   80100380 <panic>
801010ac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801010b0 <filewrite>:

//PAGEBREAK!
// Write to file f.
int
filewrite(struct file *f, char *addr, int n)
{
801010b0:	55                   	push   %ebp
801010b1:	89 e5                	mov    %esp,%ebp
801010b3:	57                   	push   %edi
801010b4:	56                   	push   %esi
801010b5:	53                   	push   %ebx
801010b6:	83 ec 1c             	sub    $0x1c,%esp
801010b9:	8b 45 0c             	mov    0xc(%ebp),%eax
801010bc:	8b 5d 08             	mov    0x8(%ebp),%ebx
801010bf:	89 45 dc             	mov    %eax,-0x24(%ebp)
801010c2:	8b 45 10             	mov    0x10(%ebp),%eax
  int r;

  if(f->writable == 0)
801010c5:	80 7b 09 00          	cmpb   $0x0,0x9(%ebx)
{
801010c9:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(f->writable == 0)
801010cc:	0f 84 bd 00 00 00    	je     8010118f <filewrite+0xdf>
    return -1;
  if(f->type == FD_PIPE)
801010d2:	8b 03                	mov    (%ebx),%eax
801010d4:	83 f8 01             	cmp    $0x1,%eax
801010d7:	0f 84 bf 00 00 00    	je     8010119c <filewrite+0xec>
    return pipewrite(f->pipe, addr, n);
  if(f->type == FD_INODE){
801010dd:	83 f8 02             	cmp    $0x2,%eax
801010e0:	0f 85 c8 00 00 00    	jne    801011ae <filewrite+0xfe>
    // and 2 blocks of slop for non-aligned writes.
    // this really belongs lower down, since writei()
    // might be writing a device like the console.
    int max = ((MAXOPBLOCKS-1-1-2) / 2) * 512;
    int i = 0;
    while(i < n){
801010e6:	8b 45 e4             	mov    -0x1c(%ebp),%eax
    int i = 0;
801010e9:	31 f6                	xor    %esi,%esi
    while(i < n){
801010eb:	85 c0                	test   %eax,%eax
801010ed:	7f 30                	jg     8010111f <filewrite+0x6f>
801010ef:	e9 94 00 00 00       	jmp    80101188 <filewrite+0xd8>
801010f4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
        n1 = max;

      begin_op();
      ilock(f->ip);
      if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
        f->off += r;
801010f8:	01 43 14             	add    %eax,0x14(%ebx)
      iunlock(f->ip);
801010fb:	83 ec 0c             	sub    $0xc,%esp
801010fe:	ff 73 10             	push   0x10(%ebx)
        f->off += r;
80101101:	89 45 e0             	mov    %eax,-0x20(%ebp)
      iunlock(f->ip);
80101104:	e8 77 07 00 00       	call   80101880 <iunlock>
      end_op();
80101109:	e8 e2 1c 00 00       	call   80102df0 <end_op>

      if(r < 0)
        break;
      if(r != n1)
8010110e:	8b 45 e0             	mov    -0x20(%ebp),%eax
80101111:	83 c4 10             	add    $0x10,%esp
80101114:	39 c7                	cmp    %eax,%edi
80101116:	75 5c                	jne    80101174 <filewrite+0xc4>
        panic("short filewrite");
      i += r;
80101118:	01 fe                	add    %edi,%esi
    while(i < n){
8010111a:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
8010111d:	7e 69                	jle    80101188 <filewrite+0xd8>
      int n1 = n - i;
8010111f:	8b 7d e4             	mov    -0x1c(%ebp),%edi
80101122:	b8 00 06 00 00       	mov    $0x600,%eax
80101127:	29 f7                	sub    %esi,%edi
80101129:	39 c7                	cmp    %eax,%edi
8010112b:	0f 4f f8             	cmovg  %eax,%edi
      begin_op();
8010112e:	e8 4d 1c 00 00       	call   80102d80 <begin_op>
      ilock(f->ip);
80101133:	83 ec 0c             	sub    $0xc,%esp
80101136:	ff 73 10             	push   0x10(%ebx)
80101139:	e8 62 06 00 00       	call   801017a0 <ilock>
      if ((r = writei(f->ip, addr + i, f->off, n1)) > 0)
8010113e:	8b 45 dc             	mov    -0x24(%ebp),%eax
80101141:	57                   	push   %edi
80101142:	ff 73 14             	push   0x14(%ebx)
80101145:	01 f0                	add    %esi,%eax
80101147:	50                   	push   %eax
80101148:	ff 73 10             	push   0x10(%ebx)
8010114b:	e8 60 0a 00 00       	call   80101bb0 <writei>
80101150:	83 c4 20             	add    $0x20,%esp
80101153:	85 c0                	test   %eax,%eax
80101155:	7f a1                	jg     801010f8 <filewrite+0x48>
      iunlock(f->ip);
80101157:	83 ec 0c             	sub    $0xc,%esp
8010115a:	ff 73 10             	push   0x10(%ebx)
8010115d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80101160:	e8 1b 07 00 00       	call   80101880 <iunlock>
      end_op();
80101165:	e8 86 1c 00 00       	call   80102df0 <end_op>
      if(r < 0)
8010116a:	8b 45 e4             	mov    -0x1c(%ebp),%eax
8010116d:	83 c4 10             	add    $0x10,%esp
80101170:	85 c0                	test   %eax,%eax
80101172:	75 1b                	jne    8010118f <filewrite+0xdf>
        panic("short filewrite");
80101174:	83 ec 0c             	sub    $0xc,%esp
80101177:	68 ef 79 10 80       	push   $0x801079ef
8010117c:	e8 ff f1 ff ff       	call   80100380 <panic>
80101181:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    }
    return i == n ? n : -1;
80101188:	89 f0                	mov    %esi,%eax
8010118a:	3b 75 e4             	cmp    -0x1c(%ebp),%esi
8010118d:	74 05                	je     80101194 <filewrite+0xe4>
8010118f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  }
  panic("filewrite");
}
80101194:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101197:	5b                   	pop    %ebx
80101198:	5e                   	pop    %esi
80101199:	5f                   	pop    %edi
8010119a:	5d                   	pop    %ebp
8010119b:	c3                   	ret    
    return pipewrite(f->pipe, addr, n);
8010119c:	8b 43 0c             	mov    0xc(%ebx),%eax
8010119f:	89 45 08             	mov    %eax,0x8(%ebp)
}
801011a2:	8d 65 f4             	lea    -0xc(%ebp),%esp
801011a5:	5b                   	pop    %ebx
801011a6:	5e                   	pop    %esi
801011a7:	5f                   	pop    %edi
801011a8:	5d                   	pop    %ebp
    return pipewrite(f->pipe, addr, n);
801011a9:	e9 42 24 00 00       	jmp    801035f0 <pipewrite>
  panic("filewrite");
801011ae:	83 ec 0c             	sub    $0xc,%esp
801011b1:	68 f5 79 10 80       	push   $0x801079f5
801011b6:	e8 c5 f1 ff ff       	call   80100380 <panic>
801011bb:	66 90                	xchg   %ax,%ax
801011bd:	66 90                	xchg   %ax,%ax
801011bf:	90                   	nop

801011c0 <balloc>:
// Blocks.

// Allocate a zeroed disk block.
static uint
balloc(uint dev)
{
801011c0:	55                   	push   %ebp
801011c1:	89 e5                	mov    %esp,%ebp
801011c3:	57                   	push   %edi
801011c4:	56                   	push   %esi
801011c5:	53                   	push   %ebx
801011c6:	83 ec 1c             	sub    $0x1c,%esp
  int b, bi, m;
  struct buf *bp;

  bp = 0;
  for(b = 0; b < sb.size; b += BPB){
801011c9:	8b 0d b4 25 11 80    	mov    0x801125b4,%ecx
{
801011cf:	89 45 d8             	mov    %eax,-0x28(%ebp)
  for(b = 0; b < sb.size; b += BPB){
801011d2:	85 c9                	test   %ecx,%ecx
801011d4:	0f 84 87 00 00 00    	je     80101261 <balloc+0xa1>
801011da:	c7 45 dc 00 00 00 00 	movl   $0x0,-0x24(%ebp)
    bp = bread(dev, BBLOCK(b, sb));
801011e1:	8b 75 dc             	mov    -0x24(%ebp),%esi
801011e4:	83 ec 08             	sub    $0x8,%esp
801011e7:	89 f0                	mov    %esi,%eax
801011e9:	c1 f8 0c             	sar    $0xc,%eax
801011ec:	03 05 cc 25 11 80    	add    0x801125cc,%eax
801011f2:	50                   	push   %eax
801011f3:	ff 75 d8             	push   -0x28(%ebp)
801011f6:	e8 d5 ee ff ff       	call   801000d0 <bread>
801011fb:	83 c4 10             	add    $0x10,%esp
801011fe:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
80101201:	a1 b4 25 11 80       	mov    0x801125b4,%eax
80101206:	89 45 e0             	mov    %eax,-0x20(%ebp)
80101209:	31 c0                	xor    %eax,%eax
8010120b:	eb 2f                	jmp    8010123c <balloc+0x7c>
8010120d:	8d 76 00             	lea    0x0(%esi),%esi
      m = 1 << (bi % 8);
80101210:	89 c1                	mov    %eax,%ecx
80101212:	bb 01 00 00 00       	mov    $0x1,%ebx
      if((bp->data[bi/8] & m) == 0){  // Is block free?
80101217:	8b 55 e4             	mov    -0x1c(%ebp),%edx
      m = 1 << (bi % 8);
8010121a:	83 e1 07             	and    $0x7,%ecx
8010121d:	d3 e3                	shl    %cl,%ebx
      if((bp->data[bi/8] & m) == 0){  // Is block free?
8010121f:	89 c1                	mov    %eax,%ecx
80101221:	c1 f9 03             	sar    $0x3,%ecx
80101224:	0f b6 7c 0a 5c       	movzbl 0x5c(%edx,%ecx,1),%edi
80101229:	89 fa                	mov    %edi,%edx
8010122b:	85 df                	test   %ebx,%edi
8010122d:	74 41                	je     80101270 <balloc+0xb0>
    for(bi = 0; bi < BPB && b + bi < sb.size; bi++){
8010122f:	83 c0 01             	add    $0x1,%eax
80101232:	83 c6 01             	add    $0x1,%esi
80101235:	3d 00 10 00 00       	cmp    $0x1000,%eax
8010123a:	74 05                	je     80101241 <balloc+0x81>
8010123c:	39 75 e0             	cmp    %esi,-0x20(%ebp)
8010123f:	77 cf                	ja     80101210 <balloc+0x50>
        brelse(bp);
        bzero(dev, b + bi);
        return b + bi;
      }
    }
    brelse(bp);
80101241:	83 ec 0c             	sub    $0xc,%esp
80101244:	ff 75 e4             	push   -0x1c(%ebp)
80101247:	e8 a4 ef ff ff       	call   801001f0 <brelse>
  for(b = 0; b < sb.size; b += BPB){
8010124c:	81 45 dc 00 10 00 00 	addl   $0x1000,-0x24(%ebp)
80101253:	83 c4 10             	add    $0x10,%esp
80101256:	8b 45 dc             	mov    -0x24(%ebp),%eax
80101259:	39 05 b4 25 11 80    	cmp    %eax,0x801125b4
8010125f:	77 80                	ja     801011e1 <balloc+0x21>
  }
  panic("balloc: out of blocks");
80101261:	83 ec 0c             	sub    $0xc,%esp
80101264:	68 ff 79 10 80       	push   $0x801079ff
80101269:	e8 12 f1 ff ff       	call   80100380 <panic>
8010126e:	66 90                	xchg   %ax,%ax
        bp->data[bi/8] |= m;  // Mark block in use.
80101270:	8b 7d e4             	mov    -0x1c(%ebp),%edi
        log_write(bp);
80101273:	83 ec 0c             	sub    $0xc,%esp
        bp->data[bi/8] |= m;  // Mark block in use.
80101276:	09 da                	or     %ebx,%edx
80101278:	88 54 0f 5c          	mov    %dl,0x5c(%edi,%ecx,1)
        log_write(bp);
8010127c:	57                   	push   %edi
8010127d:	e8 de 1c 00 00       	call   80102f60 <log_write>
        brelse(bp);
80101282:	89 3c 24             	mov    %edi,(%esp)
80101285:	e8 66 ef ff ff       	call   801001f0 <brelse>
  bp = bread(dev, bno);
8010128a:	58                   	pop    %eax
8010128b:	5a                   	pop    %edx
8010128c:	56                   	push   %esi
8010128d:	ff 75 d8             	push   -0x28(%ebp)
80101290:	e8 3b ee ff ff       	call   801000d0 <bread>
  memset(bp->data, 0, BSIZE);
80101295:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, bno);
80101298:	89 c3                	mov    %eax,%ebx
  memset(bp->data, 0, BSIZE);
8010129a:	8d 40 5c             	lea    0x5c(%eax),%eax
8010129d:	68 00 02 00 00       	push   $0x200
801012a2:	6a 00                	push   $0x0
801012a4:	50                   	push   %eax
801012a5:	e8 66 39 00 00       	call   80104c10 <memset>
  log_write(bp);
801012aa:	89 1c 24             	mov    %ebx,(%esp)
801012ad:	e8 ae 1c 00 00       	call   80102f60 <log_write>
  brelse(bp);
801012b2:	89 1c 24             	mov    %ebx,(%esp)
801012b5:	e8 36 ef ff ff       	call   801001f0 <brelse>
}
801012ba:	8d 65 f4             	lea    -0xc(%ebp),%esp
801012bd:	89 f0                	mov    %esi,%eax
801012bf:	5b                   	pop    %ebx
801012c0:	5e                   	pop    %esi
801012c1:	5f                   	pop    %edi
801012c2:	5d                   	pop    %ebp
801012c3:	c3                   	ret    
801012c4:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801012cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801012cf:	90                   	nop

801012d0 <iget>:
// Find the inode with number inum on device dev
// and return the in-memory copy. Does not lock
// the inode and does not read it from disk.
static struct inode*
iget(uint dev, uint inum)
{
801012d0:	55                   	push   %ebp
801012d1:	89 e5                	mov    %esp,%ebp
801012d3:	57                   	push   %edi
801012d4:	89 c7                	mov    %eax,%edi
801012d6:	56                   	push   %esi
  struct inode *ip, *empty;

  acquire(&icache.lock);

  // Is the inode already cached?
  empty = 0;
801012d7:	31 f6                	xor    %esi,%esi
{
801012d9:	53                   	push   %ebx
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801012da:	bb 94 09 11 80       	mov    $0x80110994,%ebx
{
801012df:	83 ec 28             	sub    $0x28,%esp
801012e2:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  acquire(&icache.lock);
801012e5:	68 60 09 11 80       	push   $0x80110960
801012ea:	e8 b1 37 00 00       	call   80104aa0 <acquire>
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
801012ef:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  acquire(&icache.lock);
801012f2:	83 c4 10             	add    $0x10,%esp
801012f5:	eb 1b                	jmp    80101312 <iget+0x42>
801012f7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801012fe:	66 90                	xchg   %ax,%ax
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101300:	39 3b                	cmp    %edi,(%ebx)
80101302:	74 6c                	je     80101370 <iget+0xa0>
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101304:	81 c3 90 00 00 00    	add    $0x90,%ebx
8010130a:	81 fb b4 25 11 80    	cmp    $0x801125b4,%ebx
80101310:	73 26                	jae    80101338 <iget+0x68>
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101312:	8b 43 08             	mov    0x8(%ebx),%eax
80101315:	85 c0                	test   %eax,%eax
80101317:	7f e7                	jg     80101300 <iget+0x30>
      ip->ref++;
      release(&icache.lock);
      return ip;
    }
    if(empty == 0 && ip->ref == 0)    // Remember empty slot.
80101319:	85 f6                	test   %esi,%esi
8010131b:	75 e7                	jne    80101304 <iget+0x34>
8010131d:	85 c0                	test   %eax,%eax
8010131f:	75 76                	jne    80101397 <iget+0xc7>
80101321:	89 de                	mov    %ebx,%esi
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101323:	81 c3 90 00 00 00    	add    $0x90,%ebx
80101329:	81 fb b4 25 11 80    	cmp    $0x801125b4,%ebx
8010132f:	72 e1                	jb     80101312 <iget+0x42>
80101331:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      empty = ip;
  }

  // Recycle an inode cache entry.
  if(empty == 0)
80101338:	85 f6                	test   %esi,%esi
8010133a:	74 79                	je     801013b5 <iget+0xe5>
  ip = empty;
  ip->dev = dev;
  ip->inum = inum;
  ip->ref = 1;
  ip->valid = 0;
  release(&icache.lock);
8010133c:	83 ec 0c             	sub    $0xc,%esp
  ip->dev = dev;
8010133f:	89 3e                	mov    %edi,(%esi)
  ip->inum = inum;
80101341:	89 56 04             	mov    %edx,0x4(%esi)
  ip->ref = 1;
80101344:	c7 46 08 01 00 00 00 	movl   $0x1,0x8(%esi)
  ip->valid = 0;
8010134b:	c7 46 4c 00 00 00 00 	movl   $0x0,0x4c(%esi)
  release(&icache.lock);
80101352:	68 60 09 11 80       	push   $0x80110960
80101357:	e8 64 38 00 00       	call   80104bc0 <release>

  return ip;
8010135c:	83 c4 10             	add    $0x10,%esp
}
8010135f:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101362:	89 f0                	mov    %esi,%eax
80101364:	5b                   	pop    %ebx
80101365:	5e                   	pop    %esi
80101366:	5f                   	pop    %edi
80101367:	5d                   	pop    %ebp
80101368:	c3                   	ret    
80101369:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
80101370:	39 53 04             	cmp    %edx,0x4(%ebx)
80101373:	75 8f                	jne    80101304 <iget+0x34>
      release(&icache.lock);
80101375:	83 ec 0c             	sub    $0xc,%esp
      ip->ref++;
80101378:	83 c0 01             	add    $0x1,%eax
      return ip;
8010137b:	89 de                	mov    %ebx,%esi
      release(&icache.lock);
8010137d:	68 60 09 11 80       	push   $0x80110960
      ip->ref++;
80101382:	89 43 08             	mov    %eax,0x8(%ebx)
      release(&icache.lock);
80101385:	e8 36 38 00 00       	call   80104bc0 <release>
      return ip;
8010138a:	83 c4 10             	add    $0x10,%esp
}
8010138d:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101390:	89 f0                	mov    %esi,%eax
80101392:	5b                   	pop    %ebx
80101393:	5e                   	pop    %esi
80101394:	5f                   	pop    %edi
80101395:	5d                   	pop    %ebp
80101396:	c3                   	ret    
  for(ip = &icache.inode[0]; ip < &icache.inode[NINODE]; ip++){
80101397:	81 c3 90 00 00 00    	add    $0x90,%ebx
8010139d:	81 fb b4 25 11 80    	cmp    $0x801125b4,%ebx
801013a3:	73 10                	jae    801013b5 <iget+0xe5>
    if(ip->ref > 0 && ip->dev == dev && ip->inum == inum){
801013a5:	8b 43 08             	mov    0x8(%ebx),%eax
801013a8:	85 c0                	test   %eax,%eax
801013aa:	0f 8f 50 ff ff ff    	jg     80101300 <iget+0x30>
801013b0:	e9 68 ff ff ff       	jmp    8010131d <iget+0x4d>
    panic("iget: no inodes");
801013b5:	83 ec 0c             	sub    $0xc,%esp
801013b8:	68 15 7a 10 80       	push   $0x80107a15
801013bd:	e8 be ef ff ff       	call   80100380 <panic>
801013c2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801013c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801013d0 <bmap>:

// Return the disk block address of the nth block in inode ip.
// If there is no such block, bmap allocates one.
static uint
bmap(struct inode *ip, uint bn)
{
801013d0:	55                   	push   %ebp
801013d1:	89 e5                	mov    %esp,%ebp
801013d3:	57                   	push   %edi
801013d4:	56                   	push   %esi
801013d5:	89 c6                	mov    %eax,%esi
801013d7:	53                   	push   %ebx
801013d8:	83 ec 1c             	sub    $0x1c,%esp
  uint addr, *a;
  struct buf *bp;

  if(bn < NDIRECT){
801013db:	83 fa 0b             	cmp    $0xb,%edx
801013de:	0f 86 8c 00 00 00    	jbe    80101470 <bmap+0xa0>
    if((addr = ip->addrs[bn]) == 0)
      ip->addrs[bn] = addr = balloc(ip->dev);
    return addr;
  }
  bn -= NDIRECT;
801013e4:	8d 5a f4             	lea    -0xc(%edx),%ebx

  if(bn < NINDIRECT){
801013e7:	83 fb 7f             	cmp    $0x7f,%ebx
801013ea:	0f 87 a2 00 00 00    	ja     80101492 <bmap+0xc2>
    // Load indirect block, allocating if necessary.
    if((addr = ip->addrs[NDIRECT]) == 0)
801013f0:	8b 80 8c 00 00 00    	mov    0x8c(%eax),%eax
801013f6:	85 c0                	test   %eax,%eax
801013f8:	74 5e                	je     80101458 <bmap+0x88>
      ip->addrs[NDIRECT] = addr = balloc(ip->dev);
    bp = bread(ip->dev, addr);
801013fa:	83 ec 08             	sub    $0x8,%esp
801013fd:	50                   	push   %eax
801013fe:	ff 36                	push   (%esi)
80101400:	e8 cb ec ff ff       	call   801000d0 <bread>
    a = (uint*)bp->data;
    if((addr = a[bn]) == 0){
80101405:	83 c4 10             	add    $0x10,%esp
80101408:	8d 5c 98 5c          	lea    0x5c(%eax,%ebx,4),%ebx
    bp = bread(ip->dev, addr);
8010140c:	89 c2                	mov    %eax,%edx
    if((addr = a[bn]) == 0){
8010140e:	8b 3b                	mov    (%ebx),%edi
80101410:	85 ff                	test   %edi,%edi
80101412:	74 1c                	je     80101430 <bmap+0x60>
      a[bn] = addr = balloc(ip->dev);
      log_write(bp);
    }
    brelse(bp);
80101414:	83 ec 0c             	sub    $0xc,%esp
80101417:	52                   	push   %edx
80101418:	e8 d3 ed ff ff       	call   801001f0 <brelse>
8010141d:	83 c4 10             	add    $0x10,%esp
    return addr;
  }

  panic("bmap: out of range");
}
80101420:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101423:	89 f8                	mov    %edi,%eax
80101425:	5b                   	pop    %ebx
80101426:	5e                   	pop    %esi
80101427:	5f                   	pop    %edi
80101428:	5d                   	pop    %ebp
80101429:	c3                   	ret    
8010142a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80101430:	89 45 e4             	mov    %eax,-0x1c(%ebp)
      a[bn] = addr = balloc(ip->dev);
80101433:	8b 06                	mov    (%esi),%eax
80101435:	e8 86 fd ff ff       	call   801011c0 <balloc>
      log_write(bp);
8010143a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
8010143d:	83 ec 0c             	sub    $0xc,%esp
      a[bn] = addr = balloc(ip->dev);
80101440:	89 03                	mov    %eax,(%ebx)
80101442:	89 c7                	mov    %eax,%edi
      log_write(bp);
80101444:	52                   	push   %edx
80101445:	e8 16 1b 00 00       	call   80102f60 <log_write>
8010144a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
8010144d:	83 c4 10             	add    $0x10,%esp
80101450:	eb c2                	jmp    80101414 <bmap+0x44>
80101452:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
      ip->addrs[NDIRECT] = addr = balloc(ip->dev);
80101458:	8b 06                	mov    (%esi),%eax
8010145a:	e8 61 fd ff ff       	call   801011c0 <balloc>
8010145f:	89 86 8c 00 00 00    	mov    %eax,0x8c(%esi)
80101465:	eb 93                	jmp    801013fa <bmap+0x2a>
80101467:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010146e:	66 90                	xchg   %ax,%ax
    if((addr = ip->addrs[bn]) == 0)
80101470:	8d 5a 14             	lea    0x14(%edx),%ebx
80101473:	8b 7c 98 0c          	mov    0xc(%eax,%ebx,4),%edi
80101477:	85 ff                	test   %edi,%edi
80101479:	75 a5                	jne    80101420 <bmap+0x50>
      ip->addrs[bn] = addr = balloc(ip->dev);
8010147b:	8b 00                	mov    (%eax),%eax
8010147d:	e8 3e fd ff ff       	call   801011c0 <balloc>
80101482:	89 44 9e 0c          	mov    %eax,0xc(%esi,%ebx,4)
80101486:	89 c7                	mov    %eax,%edi
}
80101488:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010148b:	5b                   	pop    %ebx
8010148c:	89 f8                	mov    %edi,%eax
8010148e:	5e                   	pop    %esi
8010148f:	5f                   	pop    %edi
80101490:	5d                   	pop    %ebp
80101491:	c3                   	ret    
  panic("bmap: out of range");
80101492:	83 ec 0c             	sub    $0xc,%esp
80101495:	68 25 7a 10 80       	push   $0x80107a25
8010149a:	e8 e1 ee ff ff       	call   80100380 <panic>
8010149f:	90                   	nop

801014a0 <bfree>:
{
801014a0:	55                   	push   %ebp
801014a1:	89 e5                	mov    %esp,%ebp
801014a3:	57                   	push   %edi
801014a4:	56                   	push   %esi
801014a5:	89 c6                	mov    %eax,%esi
801014a7:	53                   	push   %ebx
801014a8:	89 d3                	mov    %edx,%ebx
801014aa:	83 ec 14             	sub    $0x14,%esp
  bp = bread(dev, 1);
801014ad:	6a 01                	push   $0x1
801014af:	50                   	push   %eax
801014b0:	e8 1b ec ff ff       	call   801000d0 <bread>
  memmove(sb, bp->data, sizeof(*sb));
801014b5:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, 1);
801014b8:	89 c7                	mov    %eax,%edi
  memmove(sb, bp->data, sizeof(*sb));
801014ba:	83 c0 5c             	add    $0x5c,%eax
801014bd:	6a 1c                	push   $0x1c
801014bf:	50                   	push   %eax
801014c0:	68 b4 25 11 80       	push   $0x801125b4
801014c5:	e8 e6 37 00 00       	call   80104cb0 <memmove>
  brelse(bp);
801014ca:	89 3c 24             	mov    %edi,(%esp)
801014cd:	e8 1e ed ff ff       	call   801001f0 <brelse>
  bp = bread(dev, BBLOCK(b, sb));
801014d2:	58                   	pop    %eax
801014d3:	89 d8                	mov    %ebx,%eax
801014d5:	5a                   	pop    %edx
801014d6:	c1 e8 0c             	shr    $0xc,%eax
801014d9:	03 05 cc 25 11 80    	add    0x801125cc,%eax
801014df:	50                   	push   %eax
801014e0:	56                   	push   %esi
801014e1:	e8 ea eb ff ff       	call   801000d0 <bread>
  m = 1 << (bi % 8);
801014e6:	89 d9                	mov    %ebx,%ecx
  if((bp->data[bi/8] & m) == 0)
801014e8:	c1 fb 03             	sar    $0x3,%ebx
801014eb:	83 c4 10             	add    $0x10,%esp
  bp = bread(dev, BBLOCK(b, sb));
801014ee:	89 c6                	mov    %eax,%esi
  m = 1 << (bi % 8);
801014f0:	83 e1 07             	and    $0x7,%ecx
801014f3:	b8 01 00 00 00       	mov    $0x1,%eax
  if((bp->data[bi/8] & m) == 0)
801014f8:	81 e3 ff 01 00 00    	and    $0x1ff,%ebx
  m = 1 << (bi % 8);
801014fe:	d3 e0                	shl    %cl,%eax
  if((bp->data[bi/8] & m) == 0)
80101500:	0f b6 4c 1e 5c       	movzbl 0x5c(%esi,%ebx,1),%ecx
80101505:	85 c1                	test   %eax,%ecx
80101507:	74 24                	je     8010152d <bfree+0x8d>
  bp->data[bi/8] &= ~m;
80101509:	f7 d0                	not    %eax
  log_write(bp);
8010150b:	83 ec 0c             	sub    $0xc,%esp
  bp->data[bi/8] &= ~m;
8010150e:	21 c8                	and    %ecx,%eax
80101510:	88 44 1e 5c          	mov    %al,0x5c(%esi,%ebx,1)
  log_write(bp);
80101514:	56                   	push   %esi
80101515:	e8 46 1a 00 00       	call   80102f60 <log_write>
  brelse(bp);
8010151a:	89 34 24             	mov    %esi,(%esp)
8010151d:	e8 ce ec ff ff       	call   801001f0 <brelse>
}
80101522:	83 c4 10             	add    $0x10,%esp
80101525:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101528:	5b                   	pop    %ebx
80101529:	5e                   	pop    %esi
8010152a:	5f                   	pop    %edi
8010152b:	5d                   	pop    %ebp
8010152c:	c3                   	ret    
    panic("freeing free block");
8010152d:	83 ec 0c             	sub    $0xc,%esp
80101530:	68 38 7a 10 80       	push   $0x80107a38
80101535:	e8 46 ee ff ff       	call   80100380 <panic>
8010153a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101540 <readsb>:
{
80101540:	55                   	push   %ebp
80101541:	89 e5                	mov    %esp,%ebp
80101543:	56                   	push   %esi
80101544:	53                   	push   %ebx
80101545:	8b 75 0c             	mov    0xc(%ebp),%esi
  bp = bread(dev, 1);
80101548:	83 ec 08             	sub    $0x8,%esp
8010154b:	6a 01                	push   $0x1
8010154d:	ff 75 08             	push   0x8(%ebp)
80101550:	e8 7b eb ff ff       	call   801000d0 <bread>
  memmove(sb, bp->data, sizeof(*sb));
80101555:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, 1);
80101558:	89 c3                	mov    %eax,%ebx
  memmove(sb, bp->data, sizeof(*sb));
8010155a:	8d 40 5c             	lea    0x5c(%eax),%eax
8010155d:	6a 1c                	push   $0x1c
8010155f:	50                   	push   %eax
80101560:	56                   	push   %esi
80101561:	e8 4a 37 00 00       	call   80104cb0 <memmove>
  brelse(bp);
80101566:	89 5d 08             	mov    %ebx,0x8(%ebp)
80101569:	83 c4 10             	add    $0x10,%esp
}
8010156c:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010156f:	5b                   	pop    %ebx
80101570:	5e                   	pop    %esi
80101571:	5d                   	pop    %ebp
  brelse(bp);
80101572:	e9 79 ec ff ff       	jmp    801001f0 <brelse>
80101577:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010157e:	66 90                	xchg   %ax,%ax

80101580 <iinit>:
{
80101580:	55                   	push   %ebp
80101581:	89 e5                	mov    %esp,%ebp
80101583:	53                   	push   %ebx
80101584:	bb a0 09 11 80       	mov    $0x801109a0,%ebx
80101589:	83 ec 0c             	sub    $0xc,%esp
  initlock(&icache.lock, "icache");
8010158c:	68 4b 7a 10 80       	push   $0x80107a4b
80101591:	68 60 09 11 80       	push   $0x80110960
80101596:	e8 f5 33 00 00       	call   80104990 <initlock>
  for(i = 0; i < NINODE; i++) {
8010159b:	83 c4 10             	add    $0x10,%esp
8010159e:	66 90                	xchg   %ax,%ax
    initsleeplock(&icache.inode[i].lock, "inode");
801015a0:	83 ec 08             	sub    $0x8,%esp
801015a3:	68 52 7a 10 80       	push   $0x80107a52
801015a8:	53                   	push   %ebx
  for(i = 0; i < NINODE; i++) {
801015a9:	81 c3 90 00 00 00    	add    $0x90,%ebx
    initsleeplock(&icache.inode[i].lock, "inode");
801015af:	e8 cc 32 00 00       	call   80104880 <initsleeplock>
  for(i = 0; i < NINODE; i++) {
801015b4:	83 c4 10             	add    $0x10,%esp
801015b7:	81 fb c0 25 11 80    	cmp    $0x801125c0,%ebx
801015bd:	75 e1                	jne    801015a0 <iinit+0x20>
  bp = bread(dev, 1);
801015bf:	83 ec 08             	sub    $0x8,%esp
801015c2:	6a 01                	push   $0x1
801015c4:	ff 75 08             	push   0x8(%ebp)
801015c7:	e8 04 eb ff ff       	call   801000d0 <bread>
  memmove(sb, bp->data, sizeof(*sb));
801015cc:	83 c4 0c             	add    $0xc,%esp
  bp = bread(dev, 1);
801015cf:	89 c3                	mov    %eax,%ebx
  memmove(sb, bp->data, sizeof(*sb));
801015d1:	8d 40 5c             	lea    0x5c(%eax),%eax
801015d4:	6a 1c                	push   $0x1c
801015d6:	50                   	push   %eax
801015d7:	68 b4 25 11 80       	push   $0x801125b4
801015dc:	e8 cf 36 00 00       	call   80104cb0 <memmove>
  brelse(bp);
801015e1:	89 1c 24             	mov    %ebx,(%esp)
801015e4:	e8 07 ec ff ff       	call   801001f0 <brelse>
  cprintf("sb: size %d nblocks %d ninodes %d nlog %d logstart %d\
801015e9:	ff 35 cc 25 11 80    	push   0x801125cc
801015ef:	ff 35 c8 25 11 80    	push   0x801125c8
801015f5:	ff 35 c4 25 11 80    	push   0x801125c4
801015fb:	ff 35 c0 25 11 80    	push   0x801125c0
80101601:	ff 35 bc 25 11 80    	push   0x801125bc
80101607:	ff 35 b8 25 11 80    	push   0x801125b8
8010160d:	ff 35 b4 25 11 80    	push   0x801125b4
80101613:	68 b8 7a 10 80       	push   $0x80107ab8
80101618:	e8 83 f0 ff ff       	call   801006a0 <cprintf>
}
8010161d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80101620:	83 c4 30             	add    $0x30,%esp
80101623:	c9                   	leave  
80101624:	c3                   	ret    
80101625:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010162c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80101630 <ialloc>:
{
80101630:	55                   	push   %ebp
80101631:	89 e5                	mov    %esp,%ebp
80101633:	57                   	push   %edi
80101634:	56                   	push   %esi
80101635:	53                   	push   %ebx
80101636:	83 ec 1c             	sub    $0x1c,%esp
80101639:	8b 45 0c             	mov    0xc(%ebp),%eax
  for(inum = 1; inum < sb.ninodes; inum++){
8010163c:	83 3d bc 25 11 80 01 	cmpl   $0x1,0x801125bc
{
80101643:	8b 75 08             	mov    0x8(%ebp),%esi
80101646:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  for(inum = 1; inum < sb.ninodes; inum++){
80101649:	0f 86 91 00 00 00    	jbe    801016e0 <ialloc+0xb0>
8010164f:	bf 01 00 00 00       	mov    $0x1,%edi
80101654:	eb 21                	jmp    80101677 <ialloc+0x47>
80101656:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010165d:	8d 76 00             	lea    0x0(%esi),%esi
    brelse(bp);
80101660:	83 ec 0c             	sub    $0xc,%esp
  for(inum = 1; inum < sb.ninodes; inum++){
80101663:	83 c7 01             	add    $0x1,%edi
    brelse(bp);
80101666:	53                   	push   %ebx
80101667:	e8 84 eb ff ff       	call   801001f0 <brelse>
  for(inum = 1; inum < sb.ninodes; inum++){
8010166c:	83 c4 10             	add    $0x10,%esp
8010166f:	3b 3d bc 25 11 80    	cmp    0x801125bc,%edi
80101675:	73 69                	jae    801016e0 <ialloc+0xb0>
    bp = bread(dev, IBLOCK(inum, sb));
80101677:	89 f8                	mov    %edi,%eax
80101679:	83 ec 08             	sub    $0x8,%esp
8010167c:	c1 e8 03             	shr    $0x3,%eax
8010167f:	03 05 c8 25 11 80    	add    0x801125c8,%eax
80101685:	50                   	push   %eax
80101686:	56                   	push   %esi
80101687:	e8 44 ea ff ff       	call   801000d0 <bread>
    if(dip->type == 0){  // a free inode
8010168c:	83 c4 10             	add    $0x10,%esp
    bp = bread(dev, IBLOCK(inum, sb));
8010168f:	89 c3                	mov    %eax,%ebx
    dip = (struct dinode*)bp->data + inum%IPB;
80101691:	89 f8                	mov    %edi,%eax
80101693:	83 e0 07             	and    $0x7,%eax
80101696:	c1 e0 06             	shl    $0x6,%eax
80101699:	8d 4c 03 5c          	lea    0x5c(%ebx,%eax,1),%ecx
    if(dip->type == 0){  // a free inode
8010169d:	66 83 39 00          	cmpw   $0x0,(%ecx)
801016a1:	75 bd                	jne    80101660 <ialloc+0x30>
      memset(dip, 0, sizeof(*dip));
801016a3:	83 ec 04             	sub    $0x4,%esp
801016a6:	89 4d e0             	mov    %ecx,-0x20(%ebp)
801016a9:	6a 40                	push   $0x40
801016ab:	6a 00                	push   $0x0
801016ad:	51                   	push   %ecx
801016ae:	e8 5d 35 00 00       	call   80104c10 <memset>
      dip->type = type;
801016b3:	0f b7 45 e4          	movzwl -0x1c(%ebp),%eax
801016b7:	8b 4d e0             	mov    -0x20(%ebp),%ecx
801016ba:	66 89 01             	mov    %ax,(%ecx)
      log_write(bp);   // mark it allocated on the disk
801016bd:	89 1c 24             	mov    %ebx,(%esp)
801016c0:	e8 9b 18 00 00       	call   80102f60 <log_write>
      brelse(bp);
801016c5:	89 1c 24             	mov    %ebx,(%esp)
801016c8:	e8 23 eb ff ff       	call   801001f0 <brelse>
      return iget(dev, inum);
801016cd:	83 c4 10             	add    $0x10,%esp
}
801016d0:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return iget(dev, inum);
801016d3:	89 fa                	mov    %edi,%edx
}
801016d5:	5b                   	pop    %ebx
      return iget(dev, inum);
801016d6:	89 f0                	mov    %esi,%eax
}
801016d8:	5e                   	pop    %esi
801016d9:	5f                   	pop    %edi
801016da:	5d                   	pop    %ebp
      return iget(dev, inum);
801016db:	e9 f0 fb ff ff       	jmp    801012d0 <iget>
  panic("ialloc: no inodes");
801016e0:	83 ec 0c             	sub    $0xc,%esp
801016e3:	68 58 7a 10 80       	push   $0x80107a58
801016e8:	e8 93 ec ff ff       	call   80100380 <panic>
801016ed:	8d 76 00             	lea    0x0(%esi),%esi

801016f0 <iupdate>:
{
801016f0:	55                   	push   %ebp
801016f1:	89 e5                	mov    %esp,%ebp
801016f3:	56                   	push   %esi
801016f4:	53                   	push   %ebx
801016f5:	8b 5d 08             	mov    0x8(%ebp),%ebx
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016f8:	8b 43 04             	mov    0x4(%ebx),%eax
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
801016fb:	83 c3 5c             	add    $0x5c,%ebx
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801016fe:	83 ec 08             	sub    $0x8,%esp
80101701:	c1 e8 03             	shr    $0x3,%eax
80101704:	03 05 c8 25 11 80    	add    0x801125c8,%eax
8010170a:	50                   	push   %eax
8010170b:	ff 73 a4             	push   -0x5c(%ebx)
8010170e:	e8 bd e9 ff ff       	call   801000d0 <bread>
  dip->type = ip->type;
80101713:	0f b7 53 f4          	movzwl -0xc(%ebx),%edx
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101717:	83 c4 0c             	add    $0xc,%esp
  bp = bread(ip->dev, IBLOCK(ip->inum, sb));
8010171a:	89 c6                	mov    %eax,%esi
  dip = (struct dinode*)bp->data + ip->inum%IPB;
8010171c:	8b 43 a8             	mov    -0x58(%ebx),%eax
8010171f:	83 e0 07             	and    $0x7,%eax
80101722:	c1 e0 06             	shl    $0x6,%eax
80101725:	8d 44 06 5c          	lea    0x5c(%esi,%eax,1),%eax
  dip->type = ip->type;
80101729:	66 89 10             	mov    %dx,(%eax)
  dip->major = ip->major;
8010172c:	0f b7 53 f6          	movzwl -0xa(%ebx),%edx
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
80101730:	83 c0 0c             	add    $0xc,%eax
  dip->major = ip->major;
80101733:	66 89 50 f6          	mov    %dx,-0xa(%eax)
  dip->minor = ip->minor;
80101737:	0f b7 53 f8          	movzwl -0x8(%ebx),%edx
8010173b:	66 89 50 f8          	mov    %dx,-0x8(%eax)
  dip->nlink = ip->nlink;
8010173f:	0f b7 53 fa          	movzwl -0x6(%ebx),%edx
80101743:	66 89 50 fa          	mov    %dx,-0x6(%eax)
  dip->size = ip->size;
80101747:	8b 53 fc             	mov    -0x4(%ebx),%edx
8010174a:	89 50 fc             	mov    %edx,-0x4(%eax)
  memmove(dip->addrs, ip->addrs, sizeof(ip->addrs));
8010174d:	6a 34                	push   $0x34
8010174f:	53                   	push   %ebx
80101750:	50                   	push   %eax
80101751:	e8 5a 35 00 00       	call   80104cb0 <memmove>
  log_write(bp);
80101756:	89 34 24             	mov    %esi,(%esp)
80101759:	e8 02 18 00 00       	call   80102f60 <log_write>
  brelse(bp);
8010175e:	89 75 08             	mov    %esi,0x8(%ebp)
80101761:	83 c4 10             	add    $0x10,%esp
}
80101764:	8d 65 f8             	lea    -0x8(%ebp),%esp
80101767:	5b                   	pop    %ebx
80101768:	5e                   	pop    %esi
80101769:	5d                   	pop    %ebp
  brelse(bp);
8010176a:	e9 81 ea ff ff       	jmp    801001f0 <brelse>
8010176f:	90                   	nop

80101770 <idup>:
{
80101770:	55                   	push   %ebp
80101771:	89 e5                	mov    %esp,%ebp
80101773:	53                   	push   %ebx
80101774:	83 ec 10             	sub    $0x10,%esp
80101777:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&icache.lock);
8010177a:	68 60 09 11 80       	push   $0x80110960
8010177f:	e8 1c 33 00 00       	call   80104aa0 <acquire>
  ip->ref++;
80101784:	83 43 08 01          	addl   $0x1,0x8(%ebx)
  release(&icache.lock);
80101788:	c7 04 24 60 09 11 80 	movl   $0x80110960,(%esp)
8010178f:	e8 2c 34 00 00       	call   80104bc0 <release>
}
80101794:	89 d8                	mov    %ebx,%eax
80101796:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80101799:	c9                   	leave  
8010179a:	c3                   	ret    
8010179b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010179f:	90                   	nop

801017a0 <ilock>:
{
801017a0:	55                   	push   %ebp
801017a1:	89 e5                	mov    %esp,%ebp
801017a3:	56                   	push   %esi
801017a4:	53                   	push   %ebx
801017a5:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(ip == 0 || ip->ref < 1)
801017a8:	85 db                	test   %ebx,%ebx
801017aa:	0f 84 b7 00 00 00    	je     80101867 <ilock+0xc7>
801017b0:	8b 53 08             	mov    0x8(%ebx),%edx
801017b3:	85 d2                	test   %edx,%edx
801017b5:	0f 8e ac 00 00 00    	jle    80101867 <ilock+0xc7>
  acquiresleep(&ip->lock);
801017bb:	83 ec 0c             	sub    $0xc,%esp
801017be:	8d 43 0c             	lea    0xc(%ebx),%eax
801017c1:	50                   	push   %eax
801017c2:	e8 f9 30 00 00       	call   801048c0 <acquiresleep>
  if(ip->valid == 0){
801017c7:	8b 43 4c             	mov    0x4c(%ebx),%eax
801017ca:	83 c4 10             	add    $0x10,%esp
801017cd:	85 c0                	test   %eax,%eax
801017cf:	74 0f                	je     801017e0 <ilock+0x40>
}
801017d1:	8d 65 f8             	lea    -0x8(%ebp),%esp
801017d4:	5b                   	pop    %ebx
801017d5:	5e                   	pop    %esi
801017d6:	5d                   	pop    %ebp
801017d7:	c3                   	ret    
801017d8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801017df:	90                   	nop
    bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801017e0:	8b 43 04             	mov    0x4(%ebx),%eax
801017e3:	83 ec 08             	sub    $0x8,%esp
801017e6:	c1 e8 03             	shr    $0x3,%eax
801017e9:	03 05 c8 25 11 80    	add    0x801125c8,%eax
801017ef:	50                   	push   %eax
801017f0:	ff 33                	push   (%ebx)
801017f2:	e8 d9 e8 ff ff       	call   801000d0 <bread>
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
801017f7:	83 c4 0c             	add    $0xc,%esp
    bp = bread(ip->dev, IBLOCK(ip->inum, sb));
801017fa:	89 c6                	mov    %eax,%esi
    dip = (struct dinode*)bp->data + ip->inum%IPB;
801017fc:	8b 43 04             	mov    0x4(%ebx),%eax
801017ff:	83 e0 07             	and    $0x7,%eax
80101802:	c1 e0 06             	shl    $0x6,%eax
80101805:	8d 44 06 5c          	lea    0x5c(%esi,%eax,1),%eax
    ip->type = dip->type;
80101809:	0f b7 10             	movzwl (%eax),%edx
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
8010180c:	83 c0 0c             	add    $0xc,%eax
    ip->type = dip->type;
8010180f:	66 89 53 50          	mov    %dx,0x50(%ebx)
    ip->major = dip->major;
80101813:	0f b7 50 f6          	movzwl -0xa(%eax),%edx
80101817:	66 89 53 52          	mov    %dx,0x52(%ebx)
    ip->minor = dip->minor;
8010181b:	0f b7 50 f8          	movzwl -0x8(%eax),%edx
8010181f:	66 89 53 54          	mov    %dx,0x54(%ebx)
    ip->nlink = dip->nlink;
80101823:	0f b7 50 fa          	movzwl -0x6(%eax),%edx
80101827:	66 89 53 56          	mov    %dx,0x56(%ebx)
    ip->size = dip->size;
8010182b:	8b 50 fc             	mov    -0x4(%eax),%edx
8010182e:	89 53 58             	mov    %edx,0x58(%ebx)
    memmove(ip->addrs, dip->addrs, sizeof(ip->addrs));
80101831:	6a 34                	push   $0x34
80101833:	50                   	push   %eax
80101834:	8d 43 5c             	lea    0x5c(%ebx),%eax
80101837:	50                   	push   %eax
80101838:	e8 73 34 00 00       	call   80104cb0 <memmove>
    brelse(bp);
8010183d:	89 34 24             	mov    %esi,(%esp)
80101840:	e8 ab e9 ff ff       	call   801001f0 <brelse>
    if(ip->type == 0)
80101845:	83 c4 10             	add    $0x10,%esp
80101848:	66 83 7b 50 00       	cmpw   $0x0,0x50(%ebx)
    ip->valid = 1;
8010184d:	c7 43 4c 01 00 00 00 	movl   $0x1,0x4c(%ebx)
    if(ip->type == 0)
80101854:	0f 85 77 ff ff ff    	jne    801017d1 <ilock+0x31>
      panic("ilock: no type");
8010185a:	83 ec 0c             	sub    $0xc,%esp
8010185d:	68 70 7a 10 80       	push   $0x80107a70
80101862:	e8 19 eb ff ff       	call   80100380 <panic>
    panic("ilock");
80101867:	83 ec 0c             	sub    $0xc,%esp
8010186a:	68 6a 7a 10 80       	push   $0x80107a6a
8010186f:	e8 0c eb ff ff       	call   80100380 <panic>
80101874:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010187b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010187f:	90                   	nop

80101880 <iunlock>:
{
80101880:	55                   	push   %ebp
80101881:	89 e5                	mov    %esp,%ebp
80101883:	56                   	push   %esi
80101884:	53                   	push   %ebx
80101885:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101888:	85 db                	test   %ebx,%ebx
8010188a:	74 28                	je     801018b4 <iunlock+0x34>
8010188c:	83 ec 0c             	sub    $0xc,%esp
8010188f:	8d 73 0c             	lea    0xc(%ebx),%esi
80101892:	56                   	push   %esi
80101893:	e8 c8 30 00 00       	call   80104960 <holdingsleep>
80101898:	83 c4 10             	add    $0x10,%esp
8010189b:	85 c0                	test   %eax,%eax
8010189d:	74 15                	je     801018b4 <iunlock+0x34>
8010189f:	8b 43 08             	mov    0x8(%ebx),%eax
801018a2:	85 c0                	test   %eax,%eax
801018a4:	7e 0e                	jle    801018b4 <iunlock+0x34>
  releasesleep(&ip->lock);
801018a6:	89 75 08             	mov    %esi,0x8(%ebp)
}
801018a9:	8d 65 f8             	lea    -0x8(%ebp),%esp
801018ac:	5b                   	pop    %ebx
801018ad:	5e                   	pop    %esi
801018ae:	5d                   	pop    %ebp
  releasesleep(&ip->lock);
801018af:	e9 6c 30 00 00       	jmp    80104920 <releasesleep>
    panic("iunlock");
801018b4:	83 ec 0c             	sub    $0xc,%esp
801018b7:	68 7f 7a 10 80       	push   $0x80107a7f
801018bc:	e8 bf ea ff ff       	call   80100380 <panic>
801018c1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801018c8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801018cf:	90                   	nop

801018d0 <iput>:
{
801018d0:	55                   	push   %ebp
801018d1:	89 e5                	mov    %esp,%ebp
801018d3:	57                   	push   %edi
801018d4:	56                   	push   %esi
801018d5:	53                   	push   %ebx
801018d6:	83 ec 28             	sub    $0x28,%esp
801018d9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquiresleep(&ip->lock);
801018dc:	8d 7b 0c             	lea    0xc(%ebx),%edi
801018df:	57                   	push   %edi
801018e0:	e8 db 2f 00 00       	call   801048c0 <acquiresleep>
  if(ip->valid && ip->nlink == 0){
801018e5:	8b 53 4c             	mov    0x4c(%ebx),%edx
801018e8:	83 c4 10             	add    $0x10,%esp
801018eb:	85 d2                	test   %edx,%edx
801018ed:	74 07                	je     801018f6 <iput+0x26>
801018ef:	66 83 7b 56 00       	cmpw   $0x0,0x56(%ebx)
801018f4:	74 32                	je     80101928 <iput+0x58>
  releasesleep(&ip->lock);
801018f6:	83 ec 0c             	sub    $0xc,%esp
801018f9:	57                   	push   %edi
801018fa:	e8 21 30 00 00       	call   80104920 <releasesleep>
  acquire(&icache.lock);
801018ff:	c7 04 24 60 09 11 80 	movl   $0x80110960,(%esp)
80101906:	e8 95 31 00 00       	call   80104aa0 <acquire>
  ip->ref--;
8010190b:	83 6b 08 01          	subl   $0x1,0x8(%ebx)
  release(&icache.lock);
8010190f:	83 c4 10             	add    $0x10,%esp
80101912:	c7 45 08 60 09 11 80 	movl   $0x80110960,0x8(%ebp)
}
80101919:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010191c:	5b                   	pop    %ebx
8010191d:	5e                   	pop    %esi
8010191e:	5f                   	pop    %edi
8010191f:	5d                   	pop    %ebp
  release(&icache.lock);
80101920:	e9 9b 32 00 00       	jmp    80104bc0 <release>
80101925:	8d 76 00             	lea    0x0(%esi),%esi
    acquire(&icache.lock);
80101928:	83 ec 0c             	sub    $0xc,%esp
8010192b:	68 60 09 11 80       	push   $0x80110960
80101930:	e8 6b 31 00 00       	call   80104aa0 <acquire>
    int r = ip->ref;
80101935:	8b 73 08             	mov    0x8(%ebx),%esi
    release(&icache.lock);
80101938:	c7 04 24 60 09 11 80 	movl   $0x80110960,(%esp)
8010193f:	e8 7c 32 00 00       	call   80104bc0 <release>
    if(r == 1){
80101944:	83 c4 10             	add    $0x10,%esp
80101947:	83 fe 01             	cmp    $0x1,%esi
8010194a:	75 aa                	jne    801018f6 <iput+0x26>
8010194c:	8d 8b 8c 00 00 00    	lea    0x8c(%ebx),%ecx
80101952:	89 7d e4             	mov    %edi,-0x1c(%ebp)
80101955:	8d 73 5c             	lea    0x5c(%ebx),%esi
80101958:	89 cf                	mov    %ecx,%edi
8010195a:	eb 0b                	jmp    80101967 <iput+0x97>
8010195c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
{
  int i, j;
  struct buf *bp;
  uint *a;

  for(i = 0; i < NDIRECT; i++){
80101960:	83 c6 04             	add    $0x4,%esi
80101963:	39 fe                	cmp    %edi,%esi
80101965:	74 19                	je     80101980 <iput+0xb0>
    if(ip->addrs[i]){
80101967:	8b 16                	mov    (%esi),%edx
80101969:	85 d2                	test   %edx,%edx
8010196b:	74 f3                	je     80101960 <iput+0x90>
      bfree(ip->dev, ip->addrs[i]);
8010196d:	8b 03                	mov    (%ebx),%eax
8010196f:	e8 2c fb ff ff       	call   801014a0 <bfree>
      ip->addrs[i] = 0;
80101974:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
8010197a:	eb e4                	jmp    80101960 <iput+0x90>
8010197c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    }
  }

  if(ip->addrs[NDIRECT]){
80101980:	8b 83 8c 00 00 00    	mov    0x8c(%ebx),%eax
80101986:	8b 7d e4             	mov    -0x1c(%ebp),%edi
80101989:	85 c0                	test   %eax,%eax
8010198b:	75 2d                	jne    801019ba <iput+0xea>
    bfree(ip->dev, ip->addrs[NDIRECT]);
    ip->addrs[NDIRECT] = 0;
  }

  ip->size = 0;
  iupdate(ip);
8010198d:	83 ec 0c             	sub    $0xc,%esp
  ip->size = 0;
80101990:	c7 43 58 00 00 00 00 	movl   $0x0,0x58(%ebx)
  iupdate(ip);
80101997:	53                   	push   %ebx
80101998:	e8 53 fd ff ff       	call   801016f0 <iupdate>
      ip->type = 0;
8010199d:	31 c0                	xor    %eax,%eax
8010199f:	66 89 43 50          	mov    %ax,0x50(%ebx)
      iupdate(ip);
801019a3:	89 1c 24             	mov    %ebx,(%esp)
801019a6:	e8 45 fd ff ff       	call   801016f0 <iupdate>
      ip->valid = 0;
801019ab:	c7 43 4c 00 00 00 00 	movl   $0x0,0x4c(%ebx)
801019b2:	83 c4 10             	add    $0x10,%esp
801019b5:	e9 3c ff ff ff       	jmp    801018f6 <iput+0x26>
    bp = bread(ip->dev, ip->addrs[NDIRECT]);
801019ba:	83 ec 08             	sub    $0x8,%esp
801019bd:	50                   	push   %eax
801019be:	ff 33                	push   (%ebx)
801019c0:	e8 0b e7 ff ff       	call   801000d0 <bread>
801019c5:	89 7d e0             	mov    %edi,-0x20(%ebp)
801019c8:	83 c4 10             	add    $0x10,%esp
801019cb:	8d 88 5c 02 00 00    	lea    0x25c(%eax),%ecx
801019d1:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    for(j = 0; j < NINDIRECT; j++){
801019d4:	8d 70 5c             	lea    0x5c(%eax),%esi
801019d7:	89 cf                	mov    %ecx,%edi
801019d9:	eb 0c                	jmp    801019e7 <iput+0x117>
801019db:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801019df:	90                   	nop
801019e0:	83 c6 04             	add    $0x4,%esi
801019e3:	39 f7                	cmp    %esi,%edi
801019e5:	74 0f                	je     801019f6 <iput+0x126>
      if(a[j])
801019e7:	8b 16                	mov    (%esi),%edx
801019e9:	85 d2                	test   %edx,%edx
801019eb:	74 f3                	je     801019e0 <iput+0x110>
        bfree(ip->dev, a[j]);
801019ed:	8b 03                	mov    (%ebx),%eax
801019ef:	e8 ac fa ff ff       	call   801014a0 <bfree>
801019f4:	eb ea                	jmp    801019e0 <iput+0x110>
    brelse(bp);
801019f6:	83 ec 0c             	sub    $0xc,%esp
801019f9:	ff 75 e4             	push   -0x1c(%ebp)
801019fc:	8b 7d e0             	mov    -0x20(%ebp),%edi
801019ff:	e8 ec e7 ff ff       	call   801001f0 <brelse>
    bfree(ip->dev, ip->addrs[NDIRECT]);
80101a04:	8b 93 8c 00 00 00    	mov    0x8c(%ebx),%edx
80101a0a:	8b 03                	mov    (%ebx),%eax
80101a0c:	e8 8f fa ff ff       	call   801014a0 <bfree>
    ip->addrs[NDIRECT] = 0;
80101a11:	83 c4 10             	add    $0x10,%esp
80101a14:	c7 83 8c 00 00 00 00 	movl   $0x0,0x8c(%ebx)
80101a1b:	00 00 00 
80101a1e:	e9 6a ff ff ff       	jmp    8010198d <iput+0xbd>
80101a23:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101a2a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101a30 <iunlockput>:
{
80101a30:	55                   	push   %ebp
80101a31:	89 e5                	mov    %esp,%ebp
80101a33:	56                   	push   %esi
80101a34:	53                   	push   %ebx
80101a35:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101a38:	85 db                	test   %ebx,%ebx
80101a3a:	74 34                	je     80101a70 <iunlockput+0x40>
80101a3c:	83 ec 0c             	sub    $0xc,%esp
80101a3f:	8d 73 0c             	lea    0xc(%ebx),%esi
80101a42:	56                   	push   %esi
80101a43:	e8 18 2f 00 00       	call   80104960 <holdingsleep>
80101a48:	83 c4 10             	add    $0x10,%esp
80101a4b:	85 c0                	test   %eax,%eax
80101a4d:	74 21                	je     80101a70 <iunlockput+0x40>
80101a4f:	8b 43 08             	mov    0x8(%ebx),%eax
80101a52:	85 c0                	test   %eax,%eax
80101a54:	7e 1a                	jle    80101a70 <iunlockput+0x40>
  releasesleep(&ip->lock);
80101a56:	83 ec 0c             	sub    $0xc,%esp
80101a59:	56                   	push   %esi
80101a5a:	e8 c1 2e 00 00       	call   80104920 <releasesleep>
  iput(ip);
80101a5f:	89 5d 08             	mov    %ebx,0x8(%ebp)
80101a62:	83 c4 10             	add    $0x10,%esp
}
80101a65:	8d 65 f8             	lea    -0x8(%ebp),%esp
80101a68:	5b                   	pop    %ebx
80101a69:	5e                   	pop    %esi
80101a6a:	5d                   	pop    %ebp
  iput(ip);
80101a6b:	e9 60 fe ff ff       	jmp    801018d0 <iput>
    panic("iunlock");
80101a70:	83 ec 0c             	sub    $0xc,%esp
80101a73:	68 7f 7a 10 80       	push   $0x80107a7f
80101a78:	e8 03 e9 ff ff       	call   80100380 <panic>
80101a7d:	8d 76 00             	lea    0x0(%esi),%esi

80101a80 <stati>:

// Copy stat information from inode.
// Caller must hold ip->lock.
void
stati(struct inode *ip, struct stat *st)
{
80101a80:	55                   	push   %ebp
80101a81:	89 e5                	mov    %esp,%ebp
80101a83:	8b 55 08             	mov    0x8(%ebp),%edx
80101a86:	8b 45 0c             	mov    0xc(%ebp),%eax
  st->dev = ip->dev;
80101a89:	8b 0a                	mov    (%edx),%ecx
80101a8b:	89 48 04             	mov    %ecx,0x4(%eax)
  st->ino = ip->inum;
80101a8e:	8b 4a 04             	mov    0x4(%edx),%ecx
80101a91:	89 48 08             	mov    %ecx,0x8(%eax)
  st->type = ip->type;
80101a94:	0f b7 4a 50          	movzwl 0x50(%edx),%ecx
80101a98:	66 89 08             	mov    %cx,(%eax)
  st->nlink = ip->nlink;
80101a9b:	0f b7 4a 56          	movzwl 0x56(%edx),%ecx
80101a9f:	66 89 48 0c          	mov    %cx,0xc(%eax)
  st->size = ip->size;
80101aa3:	8b 52 58             	mov    0x58(%edx),%edx
80101aa6:	89 50 10             	mov    %edx,0x10(%eax)
}
80101aa9:	5d                   	pop    %ebp
80101aaa:	c3                   	ret    
80101aab:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101aaf:	90                   	nop

80101ab0 <readi>:
//PAGEBREAK!
// Read data from inode.
// Caller must hold ip->lock.
int
readi(struct inode *ip, char *dst, uint off, uint n)
{
80101ab0:	55                   	push   %ebp
80101ab1:	89 e5                	mov    %esp,%ebp
80101ab3:	57                   	push   %edi
80101ab4:	56                   	push   %esi
80101ab5:	53                   	push   %ebx
80101ab6:	83 ec 1c             	sub    $0x1c,%esp
80101ab9:	8b 7d 0c             	mov    0xc(%ebp),%edi
80101abc:	8b 45 08             	mov    0x8(%ebp),%eax
80101abf:	8b 75 10             	mov    0x10(%ebp),%esi
80101ac2:	89 7d e0             	mov    %edi,-0x20(%ebp)
80101ac5:	8b 7d 14             	mov    0x14(%ebp),%edi
  uint tot, m;
  struct buf *bp;

  if(ip->type == T_DEV){
80101ac8:	66 83 78 50 03       	cmpw   $0x3,0x50(%eax)
{
80101acd:	89 45 d8             	mov    %eax,-0x28(%ebp)
80101ad0:	89 7d e4             	mov    %edi,-0x1c(%ebp)
  if(ip->type == T_DEV){
80101ad3:	0f 84 a7 00 00 00    	je     80101b80 <readi+0xd0>
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
      return -1;
    return devsw[ip->major].read(ip, dst, n);
  }

  if(off > ip->size || off + n < off)
80101ad9:	8b 45 d8             	mov    -0x28(%ebp),%eax
80101adc:	8b 40 58             	mov    0x58(%eax),%eax
80101adf:	39 c6                	cmp    %eax,%esi
80101ae1:	0f 87 ba 00 00 00    	ja     80101ba1 <readi+0xf1>
80101ae7:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80101aea:	31 c9                	xor    %ecx,%ecx
80101aec:	89 da                	mov    %ebx,%edx
80101aee:	01 f2                	add    %esi,%edx
80101af0:	0f 92 c1             	setb   %cl
80101af3:	89 cf                	mov    %ecx,%edi
80101af5:	0f 82 a6 00 00 00    	jb     80101ba1 <readi+0xf1>
    return -1;
  if(off + n > ip->size)
    n = ip->size - off;
80101afb:	89 c1                	mov    %eax,%ecx
80101afd:	29 f1                	sub    %esi,%ecx
80101aff:	39 d0                	cmp    %edx,%eax
80101b01:	0f 43 cb             	cmovae %ebx,%ecx
80101b04:	89 4d e4             	mov    %ecx,-0x1c(%ebp)

  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101b07:	85 c9                	test   %ecx,%ecx
80101b09:	74 67                	je     80101b72 <readi+0xc2>
80101b0b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101b0f:	90                   	nop
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101b10:	8b 5d d8             	mov    -0x28(%ebp),%ebx
80101b13:	89 f2                	mov    %esi,%edx
80101b15:	c1 ea 09             	shr    $0x9,%edx
80101b18:	89 d8                	mov    %ebx,%eax
80101b1a:	e8 b1 f8 ff ff       	call   801013d0 <bmap>
80101b1f:	83 ec 08             	sub    $0x8,%esp
80101b22:	50                   	push   %eax
80101b23:	ff 33                	push   (%ebx)
80101b25:	e8 a6 e5 ff ff       	call   801000d0 <bread>
    m = min(n - tot, BSIZE - off%BSIZE);
80101b2a:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80101b2d:	b9 00 02 00 00       	mov    $0x200,%ecx
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101b32:	89 c2                	mov    %eax,%edx
    m = min(n - tot, BSIZE - off%BSIZE);
80101b34:	89 f0                	mov    %esi,%eax
80101b36:	25 ff 01 00 00       	and    $0x1ff,%eax
80101b3b:	29 fb                	sub    %edi,%ebx
    memmove(dst, bp->data + off%BSIZE, m);
80101b3d:	89 55 dc             	mov    %edx,-0x24(%ebp)
    m = min(n - tot, BSIZE - off%BSIZE);
80101b40:	29 c1                	sub    %eax,%ecx
    memmove(dst, bp->data + off%BSIZE, m);
80101b42:	8d 44 02 5c          	lea    0x5c(%edx,%eax,1),%eax
    m = min(n - tot, BSIZE - off%BSIZE);
80101b46:	39 d9                	cmp    %ebx,%ecx
80101b48:	0f 46 d9             	cmovbe %ecx,%ebx
    memmove(dst, bp->data + off%BSIZE, m);
80101b4b:	83 c4 0c             	add    $0xc,%esp
80101b4e:	53                   	push   %ebx
  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101b4f:	01 df                	add    %ebx,%edi
80101b51:	01 de                	add    %ebx,%esi
    memmove(dst, bp->data + off%BSIZE, m);
80101b53:	50                   	push   %eax
80101b54:	ff 75 e0             	push   -0x20(%ebp)
80101b57:	e8 54 31 00 00       	call   80104cb0 <memmove>
    brelse(bp);
80101b5c:	8b 55 dc             	mov    -0x24(%ebp),%edx
80101b5f:	89 14 24             	mov    %edx,(%esp)
80101b62:	e8 89 e6 ff ff       	call   801001f0 <brelse>
  for(tot=0; tot<n; tot+=m, off+=m, dst+=m){
80101b67:	01 5d e0             	add    %ebx,-0x20(%ebp)
80101b6a:	83 c4 10             	add    $0x10,%esp
80101b6d:	39 7d e4             	cmp    %edi,-0x1c(%ebp)
80101b70:	77 9e                	ja     80101b10 <readi+0x60>
  }
  return n;
80101b72:	8b 45 e4             	mov    -0x1c(%ebp),%eax
}
80101b75:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101b78:	5b                   	pop    %ebx
80101b79:	5e                   	pop    %esi
80101b7a:	5f                   	pop    %edi
80101b7b:	5d                   	pop    %ebp
80101b7c:	c3                   	ret    
80101b7d:	8d 76 00             	lea    0x0(%esi),%esi
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
80101b80:	0f bf 40 52          	movswl 0x52(%eax),%eax
80101b84:	66 83 f8 09          	cmp    $0x9,%ax
80101b88:	77 17                	ja     80101ba1 <readi+0xf1>
80101b8a:	8b 04 c5 00 09 11 80 	mov    -0x7feef700(,%eax,8),%eax
80101b91:	85 c0                	test   %eax,%eax
80101b93:	74 0c                	je     80101ba1 <readi+0xf1>
    return devsw[ip->major].read(ip, dst, n);
80101b95:	89 7d 10             	mov    %edi,0x10(%ebp)
}
80101b98:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101b9b:	5b                   	pop    %ebx
80101b9c:	5e                   	pop    %esi
80101b9d:	5f                   	pop    %edi
80101b9e:	5d                   	pop    %ebp
    return devsw[ip->major].read(ip, dst, n);
80101b9f:	ff e0                	jmp    *%eax
      return -1;
80101ba1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80101ba6:	eb cd                	jmp    80101b75 <readi+0xc5>
80101ba8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101baf:	90                   	nop

80101bb0 <writei>:
// PAGEBREAK!
// Write data to inode.
// Caller must hold ip->lock.
int
writei(struct inode *ip, char *src, uint off, uint n)
{
80101bb0:	55                   	push   %ebp
80101bb1:	89 e5                	mov    %esp,%ebp
80101bb3:	57                   	push   %edi
80101bb4:	56                   	push   %esi
80101bb5:	53                   	push   %ebx
80101bb6:	83 ec 1c             	sub    $0x1c,%esp
80101bb9:	8b 45 08             	mov    0x8(%ebp),%eax
80101bbc:	8b 75 0c             	mov    0xc(%ebp),%esi
80101bbf:	8b 55 14             	mov    0x14(%ebp),%edx
  uint tot, m;
  struct buf *bp;

  if(ip->type == T_DEV){
80101bc2:	66 83 78 50 03       	cmpw   $0x3,0x50(%eax)
{
80101bc7:	89 75 dc             	mov    %esi,-0x24(%ebp)
80101bca:	89 45 d8             	mov    %eax,-0x28(%ebp)
80101bcd:	8b 75 10             	mov    0x10(%ebp),%esi
80101bd0:	89 55 e0             	mov    %edx,-0x20(%ebp)
  if(ip->type == T_DEV){
80101bd3:	0f 84 b7 00 00 00    	je     80101c90 <writei+0xe0>
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
      return -1;
    return devsw[ip->major].write(ip, src, n);
  }

  if(off > ip->size || off + n < off)
80101bd9:	8b 45 d8             	mov    -0x28(%ebp),%eax
80101bdc:	3b 70 58             	cmp    0x58(%eax),%esi
80101bdf:	0f 87 e7 00 00 00    	ja     80101ccc <writei+0x11c>
80101be5:	8b 7d e0             	mov    -0x20(%ebp),%edi
80101be8:	31 d2                	xor    %edx,%edx
80101bea:	89 f8                	mov    %edi,%eax
80101bec:	01 f0                	add    %esi,%eax
80101bee:	0f 92 c2             	setb   %dl
    return -1;
  if(off + n > MAXFILE*BSIZE)
80101bf1:	3d 00 18 01 00       	cmp    $0x11800,%eax
80101bf6:	0f 87 d0 00 00 00    	ja     80101ccc <writei+0x11c>
80101bfc:	85 d2                	test   %edx,%edx
80101bfe:	0f 85 c8 00 00 00    	jne    80101ccc <writei+0x11c>
    return -1;

  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101c04:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
80101c0b:	85 ff                	test   %edi,%edi
80101c0d:	74 72                	je     80101c81 <writei+0xd1>
80101c0f:	90                   	nop
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101c10:	8b 7d d8             	mov    -0x28(%ebp),%edi
80101c13:	89 f2                	mov    %esi,%edx
80101c15:	c1 ea 09             	shr    $0x9,%edx
80101c18:	89 f8                	mov    %edi,%eax
80101c1a:	e8 b1 f7 ff ff       	call   801013d0 <bmap>
80101c1f:	83 ec 08             	sub    $0x8,%esp
80101c22:	50                   	push   %eax
80101c23:	ff 37                	push   (%edi)
80101c25:	e8 a6 e4 ff ff       	call   801000d0 <bread>
    m = min(n - tot, BSIZE - off%BSIZE);
80101c2a:	b9 00 02 00 00       	mov    $0x200,%ecx
80101c2f:	8b 5d e0             	mov    -0x20(%ebp),%ebx
80101c32:	2b 5d e4             	sub    -0x1c(%ebp),%ebx
    bp = bread(ip->dev, bmap(ip, off/BSIZE));
80101c35:	89 c7                	mov    %eax,%edi
    m = min(n - tot, BSIZE - off%BSIZE);
80101c37:	89 f0                	mov    %esi,%eax
80101c39:	25 ff 01 00 00       	and    $0x1ff,%eax
80101c3e:	29 c1                	sub    %eax,%ecx
    memmove(bp->data + off%BSIZE, src, m);
80101c40:	8d 44 07 5c          	lea    0x5c(%edi,%eax,1),%eax
    m = min(n - tot, BSIZE - off%BSIZE);
80101c44:	39 d9                	cmp    %ebx,%ecx
80101c46:	0f 46 d9             	cmovbe %ecx,%ebx
    memmove(bp->data + off%BSIZE, src, m);
80101c49:	83 c4 0c             	add    $0xc,%esp
80101c4c:	53                   	push   %ebx
  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101c4d:	01 de                	add    %ebx,%esi
    memmove(bp->data + off%BSIZE, src, m);
80101c4f:	ff 75 dc             	push   -0x24(%ebp)
80101c52:	50                   	push   %eax
80101c53:	e8 58 30 00 00       	call   80104cb0 <memmove>
    log_write(bp);
80101c58:	89 3c 24             	mov    %edi,(%esp)
80101c5b:	e8 00 13 00 00       	call   80102f60 <log_write>
    brelse(bp);
80101c60:	89 3c 24             	mov    %edi,(%esp)
80101c63:	e8 88 e5 ff ff       	call   801001f0 <brelse>
  for(tot=0; tot<n; tot+=m, off+=m, src+=m){
80101c68:	01 5d e4             	add    %ebx,-0x1c(%ebp)
80101c6b:	83 c4 10             	add    $0x10,%esp
80101c6e:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80101c71:	01 5d dc             	add    %ebx,-0x24(%ebp)
80101c74:	39 45 e0             	cmp    %eax,-0x20(%ebp)
80101c77:	77 97                	ja     80101c10 <writei+0x60>
  }

  if(n > 0 && off > ip->size){
80101c79:	8b 45 d8             	mov    -0x28(%ebp),%eax
80101c7c:	3b 70 58             	cmp    0x58(%eax),%esi
80101c7f:	77 37                	ja     80101cb8 <writei+0x108>
    ip->size = off;
    iupdate(ip);
  }
  return n;
80101c81:	8b 45 e0             	mov    -0x20(%ebp),%eax
}
80101c84:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101c87:	5b                   	pop    %ebx
80101c88:	5e                   	pop    %esi
80101c89:	5f                   	pop    %edi
80101c8a:	5d                   	pop    %ebp
80101c8b:	c3                   	ret    
80101c8c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
80101c90:	0f bf 40 52          	movswl 0x52(%eax),%eax
80101c94:	66 83 f8 09          	cmp    $0x9,%ax
80101c98:	77 32                	ja     80101ccc <writei+0x11c>
80101c9a:	8b 04 c5 04 09 11 80 	mov    -0x7feef6fc(,%eax,8),%eax
80101ca1:	85 c0                	test   %eax,%eax
80101ca3:	74 27                	je     80101ccc <writei+0x11c>
    return devsw[ip->major].write(ip, src, n);
80101ca5:	89 55 10             	mov    %edx,0x10(%ebp)
}
80101ca8:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101cab:	5b                   	pop    %ebx
80101cac:	5e                   	pop    %esi
80101cad:	5f                   	pop    %edi
80101cae:	5d                   	pop    %ebp
    return devsw[ip->major].write(ip, src, n);
80101caf:	ff e0                	jmp    *%eax
80101cb1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    ip->size = off;
80101cb8:	8b 45 d8             	mov    -0x28(%ebp),%eax
    iupdate(ip);
80101cbb:	83 ec 0c             	sub    $0xc,%esp
    ip->size = off;
80101cbe:	89 70 58             	mov    %esi,0x58(%eax)
    iupdate(ip);
80101cc1:	50                   	push   %eax
80101cc2:	e8 29 fa ff ff       	call   801016f0 <iupdate>
80101cc7:	83 c4 10             	add    $0x10,%esp
80101cca:	eb b5                	jmp    80101c81 <writei+0xd1>
      return -1;
80101ccc:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80101cd1:	eb b1                	jmp    80101c84 <writei+0xd4>
80101cd3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101cda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80101ce0 <namecmp>:
//PAGEBREAK!
// Directories

int
namecmp(const char *s, const char *t)
{
80101ce0:	55                   	push   %ebp
80101ce1:	89 e5                	mov    %esp,%ebp
80101ce3:	83 ec 0c             	sub    $0xc,%esp
  return strncmp(s, t, DIRSIZ);
80101ce6:	6a 0e                	push   $0xe
80101ce8:	ff 75 0c             	push   0xc(%ebp)
80101ceb:	ff 75 08             	push   0x8(%ebp)
80101cee:	e8 2d 30 00 00       	call   80104d20 <strncmp>
}
80101cf3:	c9                   	leave  
80101cf4:	c3                   	ret    
80101cf5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80101cfc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80101d00 <dirlookup>:

// Look for a directory entry in a directory.
// If found, set *poff to byte offset of entry.
struct inode*
dirlookup(struct inode *dp, char *name, uint *poff)
{
80101d00:	55                   	push   %ebp
80101d01:	89 e5                	mov    %esp,%ebp
80101d03:	57                   	push   %edi
80101d04:	56                   	push   %esi
80101d05:	53                   	push   %ebx
80101d06:	83 ec 1c             	sub    $0x1c,%esp
80101d09:	8b 5d 08             	mov    0x8(%ebp),%ebx
  uint off, inum;
  struct dirent de;

  if(dp->type != T_DIR)
80101d0c:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80101d11:	0f 85 85 00 00 00    	jne    80101d9c <dirlookup+0x9c>
    panic("dirlookup not DIR");

  for(off = 0; off < dp->size; off += sizeof(de)){
80101d17:	8b 53 58             	mov    0x58(%ebx),%edx
80101d1a:	31 ff                	xor    %edi,%edi
80101d1c:	8d 75 d8             	lea    -0x28(%ebp),%esi
80101d1f:	85 d2                	test   %edx,%edx
80101d21:	74 3e                	je     80101d61 <dirlookup+0x61>
80101d23:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101d27:	90                   	nop
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80101d28:	6a 10                	push   $0x10
80101d2a:	57                   	push   %edi
80101d2b:	56                   	push   %esi
80101d2c:	53                   	push   %ebx
80101d2d:	e8 7e fd ff ff       	call   80101ab0 <readi>
80101d32:	83 c4 10             	add    $0x10,%esp
80101d35:	83 f8 10             	cmp    $0x10,%eax
80101d38:	75 55                	jne    80101d8f <dirlookup+0x8f>
      panic("dirlookup read");
    if(de.inum == 0)
80101d3a:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
80101d3f:	74 18                	je     80101d59 <dirlookup+0x59>
  return strncmp(s, t, DIRSIZ);
80101d41:	83 ec 04             	sub    $0x4,%esp
80101d44:	8d 45 da             	lea    -0x26(%ebp),%eax
80101d47:	6a 0e                	push   $0xe
80101d49:	50                   	push   %eax
80101d4a:	ff 75 0c             	push   0xc(%ebp)
80101d4d:	e8 ce 2f 00 00       	call   80104d20 <strncmp>
      continue;
    if(namecmp(name, de.name) == 0){
80101d52:	83 c4 10             	add    $0x10,%esp
80101d55:	85 c0                	test   %eax,%eax
80101d57:	74 17                	je     80101d70 <dirlookup+0x70>
  for(off = 0; off < dp->size; off += sizeof(de)){
80101d59:	83 c7 10             	add    $0x10,%edi
80101d5c:	3b 7b 58             	cmp    0x58(%ebx),%edi
80101d5f:	72 c7                	jb     80101d28 <dirlookup+0x28>
      return iget(dp->dev, inum);
    }
  }

  return 0;
}
80101d61:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80101d64:	31 c0                	xor    %eax,%eax
}
80101d66:	5b                   	pop    %ebx
80101d67:	5e                   	pop    %esi
80101d68:	5f                   	pop    %edi
80101d69:	5d                   	pop    %ebp
80101d6a:	c3                   	ret    
80101d6b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80101d6f:	90                   	nop
      if(poff)
80101d70:	8b 45 10             	mov    0x10(%ebp),%eax
80101d73:	85 c0                	test   %eax,%eax
80101d75:	74 05                	je     80101d7c <dirlookup+0x7c>
        *poff = off;
80101d77:	8b 45 10             	mov    0x10(%ebp),%eax
80101d7a:	89 38                	mov    %edi,(%eax)
      inum = de.inum;
80101d7c:	0f b7 55 d8          	movzwl -0x28(%ebp),%edx
      return iget(dp->dev, inum);
80101d80:	8b 03                	mov    (%ebx),%eax
80101d82:	e8 49 f5 ff ff       	call   801012d0 <iget>
}
80101d87:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101d8a:	5b                   	pop    %ebx
80101d8b:	5e                   	pop    %esi
80101d8c:	5f                   	pop    %edi
80101d8d:	5d                   	pop    %ebp
80101d8e:	c3                   	ret    
      panic("dirlookup read");
80101d8f:	83 ec 0c             	sub    $0xc,%esp
80101d92:	68 99 7a 10 80       	push   $0x80107a99
80101d97:	e8 e4 e5 ff ff       	call   80100380 <panic>
    panic("dirlookup not DIR");
80101d9c:	83 ec 0c             	sub    $0xc,%esp
80101d9f:	68 87 7a 10 80       	push   $0x80107a87
80101da4:	e8 d7 e5 ff ff       	call   80100380 <panic>
80101da9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80101db0 <namex>:
// If parent != 0, return the inode for the parent and copy the final
// path element into name, which must have room for DIRSIZ bytes.
// Must be called inside a transaction since it calls iput().
static struct inode*
namex(char *path, int nameiparent, char *name)
{
80101db0:	55                   	push   %ebp
80101db1:	89 e5                	mov    %esp,%ebp
80101db3:	57                   	push   %edi
80101db4:	56                   	push   %esi
80101db5:	53                   	push   %ebx
80101db6:	89 c3                	mov    %eax,%ebx
80101db8:	83 ec 1c             	sub    $0x1c,%esp
  struct inode *ip, *next;

  if(*path == '/')
80101dbb:	80 38 2f             	cmpb   $0x2f,(%eax)
{
80101dbe:	89 55 dc             	mov    %edx,-0x24(%ebp)
80101dc1:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
  if(*path == '/')
80101dc4:	0f 84 64 01 00 00    	je     80101f2e <namex+0x17e>
    ip = iget(ROOTDEV, ROOTINO);
  else
    ip = idup(myproc()->cwd);
80101dca:	e8 d1 1b 00 00       	call   801039a0 <myproc>
  acquire(&icache.lock);
80101dcf:	83 ec 0c             	sub    $0xc,%esp
    ip = idup(myproc()->cwd);
80101dd2:	8b 70 68             	mov    0x68(%eax),%esi
  acquire(&icache.lock);
80101dd5:	68 60 09 11 80       	push   $0x80110960
80101dda:	e8 c1 2c 00 00       	call   80104aa0 <acquire>
  ip->ref++;
80101ddf:	83 46 08 01          	addl   $0x1,0x8(%esi)
  release(&icache.lock);
80101de3:	c7 04 24 60 09 11 80 	movl   $0x80110960,(%esp)
80101dea:	e8 d1 2d 00 00       	call   80104bc0 <release>
80101def:	83 c4 10             	add    $0x10,%esp
80101df2:	eb 07                	jmp    80101dfb <namex+0x4b>
80101df4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    path++;
80101df8:	83 c3 01             	add    $0x1,%ebx
  while(*path == '/')
80101dfb:	0f b6 03             	movzbl (%ebx),%eax
80101dfe:	3c 2f                	cmp    $0x2f,%al
80101e00:	74 f6                	je     80101df8 <namex+0x48>
  if(*path == 0)
80101e02:	84 c0                	test   %al,%al
80101e04:	0f 84 06 01 00 00    	je     80101f10 <namex+0x160>
  while(*path != '/' && *path != 0)
80101e0a:	0f b6 03             	movzbl (%ebx),%eax
80101e0d:	84 c0                	test   %al,%al
80101e0f:	0f 84 10 01 00 00    	je     80101f25 <namex+0x175>
80101e15:	89 df                	mov    %ebx,%edi
80101e17:	3c 2f                	cmp    $0x2f,%al
80101e19:	0f 84 06 01 00 00    	je     80101f25 <namex+0x175>
80101e1f:	90                   	nop
80101e20:	0f b6 47 01          	movzbl 0x1(%edi),%eax
    path++;
80101e24:	83 c7 01             	add    $0x1,%edi
  while(*path != '/' && *path != 0)
80101e27:	3c 2f                	cmp    $0x2f,%al
80101e29:	74 04                	je     80101e2f <namex+0x7f>
80101e2b:	84 c0                	test   %al,%al
80101e2d:	75 f1                	jne    80101e20 <namex+0x70>
  len = path - s;
80101e2f:	89 f8                	mov    %edi,%eax
80101e31:	29 d8                	sub    %ebx,%eax
  if(len >= DIRSIZ)
80101e33:	83 f8 0d             	cmp    $0xd,%eax
80101e36:	0f 8e ac 00 00 00    	jle    80101ee8 <namex+0x138>
    memmove(name, s, DIRSIZ);
80101e3c:	83 ec 04             	sub    $0x4,%esp
80101e3f:	6a 0e                	push   $0xe
80101e41:	53                   	push   %ebx
    path++;
80101e42:	89 fb                	mov    %edi,%ebx
    memmove(name, s, DIRSIZ);
80101e44:	ff 75 e4             	push   -0x1c(%ebp)
80101e47:	e8 64 2e 00 00       	call   80104cb0 <memmove>
80101e4c:	83 c4 10             	add    $0x10,%esp
  while(*path == '/')
80101e4f:	80 3f 2f             	cmpb   $0x2f,(%edi)
80101e52:	75 0c                	jne    80101e60 <namex+0xb0>
80101e54:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    path++;
80101e58:	83 c3 01             	add    $0x1,%ebx
  while(*path == '/')
80101e5b:	80 3b 2f             	cmpb   $0x2f,(%ebx)
80101e5e:	74 f8                	je     80101e58 <namex+0xa8>

  while((path = skipelem(path, name)) != 0){
    ilock(ip);
80101e60:	83 ec 0c             	sub    $0xc,%esp
80101e63:	56                   	push   %esi
80101e64:	e8 37 f9 ff ff       	call   801017a0 <ilock>
    if(ip->type != T_DIR){
80101e69:	83 c4 10             	add    $0x10,%esp
80101e6c:	66 83 7e 50 01       	cmpw   $0x1,0x50(%esi)
80101e71:	0f 85 cd 00 00 00    	jne    80101f44 <namex+0x194>
      iunlockput(ip);
      return 0;
    }
    if(nameiparent && *path == '\0'){
80101e77:	8b 45 dc             	mov    -0x24(%ebp),%eax
80101e7a:	85 c0                	test   %eax,%eax
80101e7c:	74 09                	je     80101e87 <namex+0xd7>
80101e7e:	80 3b 00             	cmpb   $0x0,(%ebx)
80101e81:	0f 84 22 01 00 00    	je     80101fa9 <namex+0x1f9>
      // Stop one level early.
      iunlock(ip);
      return ip;
    }
    if((next = dirlookup(ip, name, 0)) == 0){
80101e87:	83 ec 04             	sub    $0x4,%esp
80101e8a:	6a 00                	push   $0x0
80101e8c:	ff 75 e4             	push   -0x1c(%ebp)
80101e8f:	56                   	push   %esi
80101e90:	e8 6b fe ff ff       	call   80101d00 <dirlookup>
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101e95:	8d 56 0c             	lea    0xc(%esi),%edx
    if((next = dirlookup(ip, name, 0)) == 0){
80101e98:	83 c4 10             	add    $0x10,%esp
80101e9b:	89 c7                	mov    %eax,%edi
80101e9d:	85 c0                	test   %eax,%eax
80101e9f:	0f 84 e1 00 00 00    	je     80101f86 <namex+0x1d6>
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101ea5:	83 ec 0c             	sub    $0xc,%esp
80101ea8:	89 55 e0             	mov    %edx,-0x20(%ebp)
80101eab:	52                   	push   %edx
80101eac:	e8 af 2a 00 00       	call   80104960 <holdingsleep>
80101eb1:	83 c4 10             	add    $0x10,%esp
80101eb4:	85 c0                	test   %eax,%eax
80101eb6:	0f 84 30 01 00 00    	je     80101fec <namex+0x23c>
80101ebc:	8b 56 08             	mov    0x8(%esi),%edx
80101ebf:	85 d2                	test   %edx,%edx
80101ec1:	0f 8e 25 01 00 00    	jle    80101fec <namex+0x23c>
  releasesleep(&ip->lock);
80101ec7:	8b 55 e0             	mov    -0x20(%ebp),%edx
80101eca:	83 ec 0c             	sub    $0xc,%esp
80101ecd:	52                   	push   %edx
80101ece:	e8 4d 2a 00 00       	call   80104920 <releasesleep>
  iput(ip);
80101ed3:	89 34 24             	mov    %esi,(%esp)
80101ed6:	89 fe                	mov    %edi,%esi
80101ed8:	e8 f3 f9 ff ff       	call   801018d0 <iput>
80101edd:	83 c4 10             	add    $0x10,%esp
80101ee0:	e9 16 ff ff ff       	jmp    80101dfb <namex+0x4b>
80101ee5:	8d 76 00             	lea    0x0(%esi),%esi
    name[len] = 0;
80101ee8:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
80101eeb:	8d 14 01             	lea    (%ecx,%eax,1),%edx
    memmove(name, s, len);
80101eee:	83 ec 04             	sub    $0x4,%esp
80101ef1:	89 55 e0             	mov    %edx,-0x20(%ebp)
80101ef4:	50                   	push   %eax
80101ef5:	53                   	push   %ebx
    name[len] = 0;
80101ef6:	89 fb                	mov    %edi,%ebx
    memmove(name, s, len);
80101ef8:	ff 75 e4             	push   -0x1c(%ebp)
80101efb:	e8 b0 2d 00 00       	call   80104cb0 <memmove>
    name[len] = 0;
80101f00:	8b 55 e0             	mov    -0x20(%ebp),%edx
80101f03:	83 c4 10             	add    $0x10,%esp
80101f06:	c6 02 00             	movb   $0x0,(%edx)
80101f09:	e9 41 ff ff ff       	jmp    80101e4f <namex+0x9f>
80101f0e:	66 90                	xchg   %ax,%ax
      return 0;
    }
    iunlockput(ip);
    ip = next;
  }
  if(nameiparent){
80101f10:	8b 45 dc             	mov    -0x24(%ebp),%eax
80101f13:	85 c0                	test   %eax,%eax
80101f15:	0f 85 be 00 00 00    	jne    80101fd9 <namex+0x229>
    iput(ip);
    return 0;
  }
  return ip;
}
80101f1b:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101f1e:	89 f0                	mov    %esi,%eax
80101f20:	5b                   	pop    %ebx
80101f21:	5e                   	pop    %esi
80101f22:	5f                   	pop    %edi
80101f23:	5d                   	pop    %ebp
80101f24:	c3                   	ret    
  while(*path != '/' && *path != 0)
80101f25:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80101f28:	89 df                	mov    %ebx,%edi
80101f2a:	31 c0                	xor    %eax,%eax
80101f2c:	eb c0                	jmp    80101eee <namex+0x13e>
    ip = iget(ROOTDEV, ROOTINO);
80101f2e:	ba 01 00 00 00       	mov    $0x1,%edx
80101f33:	b8 01 00 00 00       	mov    $0x1,%eax
80101f38:	e8 93 f3 ff ff       	call   801012d0 <iget>
80101f3d:	89 c6                	mov    %eax,%esi
80101f3f:	e9 b7 fe ff ff       	jmp    80101dfb <namex+0x4b>
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101f44:	83 ec 0c             	sub    $0xc,%esp
80101f47:	8d 5e 0c             	lea    0xc(%esi),%ebx
80101f4a:	53                   	push   %ebx
80101f4b:	e8 10 2a 00 00       	call   80104960 <holdingsleep>
80101f50:	83 c4 10             	add    $0x10,%esp
80101f53:	85 c0                	test   %eax,%eax
80101f55:	0f 84 91 00 00 00    	je     80101fec <namex+0x23c>
80101f5b:	8b 46 08             	mov    0x8(%esi),%eax
80101f5e:	85 c0                	test   %eax,%eax
80101f60:	0f 8e 86 00 00 00    	jle    80101fec <namex+0x23c>
  releasesleep(&ip->lock);
80101f66:	83 ec 0c             	sub    $0xc,%esp
80101f69:	53                   	push   %ebx
80101f6a:	e8 b1 29 00 00       	call   80104920 <releasesleep>
  iput(ip);
80101f6f:	89 34 24             	mov    %esi,(%esp)
      return 0;
80101f72:	31 f6                	xor    %esi,%esi
  iput(ip);
80101f74:	e8 57 f9 ff ff       	call   801018d0 <iput>
      return 0;
80101f79:	83 c4 10             	add    $0x10,%esp
}
80101f7c:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101f7f:	89 f0                	mov    %esi,%eax
80101f81:	5b                   	pop    %ebx
80101f82:	5e                   	pop    %esi
80101f83:	5f                   	pop    %edi
80101f84:	5d                   	pop    %ebp
80101f85:	c3                   	ret    
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101f86:	83 ec 0c             	sub    $0xc,%esp
80101f89:	89 55 e4             	mov    %edx,-0x1c(%ebp)
80101f8c:	52                   	push   %edx
80101f8d:	e8 ce 29 00 00       	call   80104960 <holdingsleep>
80101f92:	83 c4 10             	add    $0x10,%esp
80101f95:	85 c0                	test   %eax,%eax
80101f97:	74 53                	je     80101fec <namex+0x23c>
80101f99:	8b 4e 08             	mov    0x8(%esi),%ecx
80101f9c:	85 c9                	test   %ecx,%ecx
80101f9e:	7e 4c                	jle    80101fec <namex+0x23c>
  releasesleep(&ip->lock);
80101fa0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80101fa3:	83 ec 0c             	sub    $0xc,%esp
80101fa6:	52                   	push   %edx
80101fa7:	eb c1                	jmp    80101f6a <namex+0x1ba>
  if(ip == 0 || !holdingsleep(&ip->lock) || ip->ref < 1)
80101fa9:	83 ec 0c             	sub    $0xc,%esp
80101fac:	8d 5e 0c             	lea    0xc(%esi),%ebx
80101faf:	53                   	push   %ebx
80101fb0:	e8 ab 29 00 00       	call   80104960 <holdingsleep>
80101fb5:	83 c4 10             	add    $0x10,%esp
80101fb8:	85 c0                	test   %eax,%eax
80101fba:	74 30                	je     80101fec <namex+0x23c>
80101fbc:	8b 7e 08             	mov    0x8(%esi),%edi
80101fbf:	85 ff                	test   %edi,%edi
80101fc1:	7e 29                	jle    80101fec <namex+0x23c>
  releasesleep(&ip->lock);
80101fc3:	83 ec 0c             	sub    $0xc,%esp
80101fc6:	53                   	push   %ebx
80101fc7:	e8 54 29 00 00       	call   80104920 <releasesleep>
}
80101fcc:	83 c4 10             	add    $0x10,%esp
}
80101fcf:	8d 65 f4             	lea    -0xc(%ebp),%esp
80101fd2:	89 f0                	mov    %esi,%eax
80101fd4:	5b                   	pop    %ebx
80101fd5:	5e                   	pop    %esi
80101fd6:	5f                   	pop    %edi
80101fd7:	5d                   	pop    %ebp
80101fd8:	c3                   	ret    
    iput(ip);
80101fd9:	83 ec 0c             	sub    $0xc,%esp
80101fdc:	56                   	push   %esi
    return 0;
80101fdd:	31 f6                	xor    %esi,%esi
    iput(ip);
80101fdf:	e8 ec f8 ff ff       	call   801018d0 <iput>
    return 0;
80101fe4:	83 c4 10             	add    $0x10,%esp
80101fe7:	e9 2f ff ff ff       	jmp    80101f1b <namex+0x16b>
    panic("iunlock");
80101fec:	83 ec 0c             	sub    $0xc,%esp
80101fef:	68 7f 7a 10 80       	push   $0x80107a7f
80101ff4:	e8 87 e3 ff ff       	call   80100380 <panic>
80101ff9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102000 <dirlink>:
{
80102000:	55                   	push   %ebp
80102001:	89 e5                	mov    %esp,%ebp
80102003:	57                   	push   %edi
80102004:	56                   	push   %esi
80102005:	53                   	push   %ebx
80102006:	83 ec 20             	sub    $0x20,%esp
80102009:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if((ip = dirlookup(dp, name, 0)) != 0){
8010200c:	6a 00                	push   $0x0
8010200e:	ff 75 0c             	push   0xc(%ebp)
80102011:	53                   	push   %ebx
80102012:	e8 e9 fc ff ff       	call   80101d00 <dirlookup>
80102017:	83 c4 10             	add    $0x10,%esp
8010201a:	85 c0                	test   %eax,%eax
8010201c:	75 67                	jne    80102085 <dirlink+0x85>
  for(off = 0; off < dp->size; off += sizeof(de)){
8010201e:	8b 7b 58             	mov    0x58(%ebx),%edi
80102021:	8d 75 d8             	lea    -0x28(%ebp),%esi
80102024:	85 ff                	test   %edi,%edi
80102026:	74 29                	je     80102051 <dirlink+0x51>
80102028:	31 ff                	xor    %edi,%edi
8010202a:	8d 75 d8             	lea    -0x28(%ebp),%esi
8010202d:	eb 09                	jmp    80102038 <dirlink+0x38>
8010202f:	90                   	nop
80102030:	83 c7 10             	add    $0x10,%edi
80102033:	3b 7b 58             	cmp    0x58(%ebx),%edi
80102036:	73 19                	jae    80102051 <dirlink+0x51>
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102038:	6a 10                	push   $0x10
8010203a:	57                   	push   %edi
8010203b:	56                   	push   %esi
8010203c:	53                   	push   %ebx
8010203d:	e8 6e fa ff ff       	call   80101ab0 <readi>
80102042:	83 c4 10             	add    $0x10,%esp
80102045:	83 f8 10             	cmp    $0x10,%eax
80102048:	75 4e                	jne    80102098 <dirlink+0x98>
    if(de.inum == 0)
8010204a:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
8010204f:	75 df                	jne    80102030 <dirlink+0x30>
  strncpy(de.name, name, DIRSIZ);
80102051:	83 ec 04             	sub    $0x4,%esp
80102054:	8d 45 da             	lea    -0x26(%ebp),%eax
80102057:	6a 0e                	push   $0xe
80102059:	ff 75 0c             	push   0xc(%ebp)
8010205c:	50                   	push   %eax
8010205d:	e8 0e 2d 00 00       	call   80104d70 <strncpy>
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102062:	6a 10                	push   $0x10
  de.inum = inum;
80102064:	8b 45 10             	mov    0x10(%ebp),%eax
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80102067:	57                   	push   %edi
80102068:	56                   	push   %esi
80102069:	53                   	push   %ebx
  de.inum = inum;
8010206a:	66 89 45 d8          	mov    %ax,-0x28(%ebp)
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
8010206e:	e8 3d fb ff ff       	call   80101bb0 <writei>
80102073:	83 c4 20             	add    $0x20,%esp
80102076:	83 f8 10             	cmp    $0x10,%eax
80102079:	75 2a                	jne    801020a5 <dirlink+0xa5>
  return 0;
8010207b:	31 c0                	xor    %eax,%eax
}
8010207d:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102080:	5b                   	pop    %ebx
80102081:	5e                   	pop    %esi
80102082:	5f                   	pop    %edi
80102083:	5d                   	pop    %ebp
80102084:	c3                   	ret    
    iput(ip);
80102085:	83 ec 0c             	sub    $0xc,%esp
80102088:	50                   	push   %eax
80102089:	e8 42 f8 ff ff       	call   801018d0 <iput>
    return -1;
8010208e:	83 c4 10             	add    $0x10,%esp
80102091:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80102096:	eb e5                	jmp    8010207d <dirlink+0x7d>
      panic("dirlink read");
80102098:	83 ec 0c             	sub    $0xc,%esp
8010209b:	68 a8 7a 10 80       	push   $0x80107aa8
801020a0:	e8 db e2 ff ff       	call   80100380 <panic>
    panic("dirlink");
801020a5:	83 ec 0c             	sub    $0xc,%esp
801020a8:	68 de 80 10 80       	push   $0x801080de
801020ad:	e8 ce e2 ff ff       	call   80100380 <panic>
801020b2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801020b9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801020c0 <namei>:

struct inode*
namei(char *path)
{
801020c0:	55                   	push   %ebp
  char name[DIRSIZ];
  return namex(path, 0, name);
801020c1:	31 d2                	xor    %edx,%edx
{
801020c3:	89 e5                	mov    %esp,%ebp
801020c5:	83 ec 18             	sub    $0x18,%esp
  return namex(path, 0, name);
801020c8:	8b 45 08             	mov    0x8(%ebp),%eax
801020cb:	8d 4d ea             	lea    -0x16(%ebp),%ecx
801020ce:	e8 dd fc ff ff       	call   80101db0 <namex>
}
801020d3:	c9                   	leave  
801020d4:	c3                   	ret    
801020d5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801020dc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801020e0 <nameiparent>:

struct inode*
nameiparent(char *path, char *name)
{
801020e0:	55                   	push   %ebp
  return namex(path, 1, name);
801020e1:	ba 01 00 00 00       	mov    $0x1,%edx
{
801020e6:	89 e5                	mov    %esp,%ebp
  return namex(path, 1, name);
801020e8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
801020eb:	8b 45 08             	mov    0x8(%ebp),%eax
}
801020ee:	5d                   	pop    %ebp
  return namex(path, 1, name);
801020ef:	e9 bc fc ff ff       	jmp    80101db0 <namex>
801020f4:	66 90                	xchg   %ax,%ax
801020f6:	66 90                	xchg   %ax,%ax
801020f8:	66 90                	xchg   %ax,%ax
801020fa:	66 90                	xchg   %ax,%ax
801020fc:	66 90                	xchg   %ax,%ax
801020fe:	66 90                	xchg   %ax,%ax

80102100 <idestart>:
}

// Start the request for b.  Caller must hold idelock.
static void
idestart(struct buf *b)
{
80102100:	55                   	push   %ebp
80102101:	89 e5                	mov    %esp,%ebp
80102103:	57                   	push   %edi
80102104:	56                   	push   %esi
80102105:	53                   	push   %ebx
80102106:	83 ec 0c             	sub    $0xc,%esp
  if(b == 0)
80102109:	85 c0                	test   %eax,%eax
8010210b:	0f 84 b4 00 00 00    	je     801021c5 <idestart+0xc5>
    panic("idestart");
  if(b->blockno >= FSSIZE)
80102111:	8b 70 08             	mov    0x8(%eax),%esi
80102114:	89 c3                	mov    %eax,%ebx
80102116:	81 fe e7 03 00 00    	cmp    $0x3e7,%esi
8010211c:	0f 87 96 00 00 00    	ja     801021b8 <idestart+0xb8>
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102122:	b9 f7 01 00 00       	mov    $0x1f7,%ecx
80102127:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010212e:	66 90                	xchg   %ax,%ax
80102130:	89 ca                	mov    %ecx,%edx
80102132:	ec                   	in     (%dx),%al
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102133:	83 e0 c0             	and    $0xffffffc0,%eax
80102136:	3c 40                	cmp    $0x40,%al
80102138:	75 f6                	jne    80102130 <idestart+0x30>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
8010213a:	31 ff                	xor    %edi,%edi
8010213c:	ba f6 03 00 00       	mov    $0x3f6,%edx
80102141:	89 f8                	mov    %edi,%eax
80102143:	ee                   	out    %al,(%dx)
80102144:	b8 01 00 00 00       	mov    $0x1,%eax
80102149:	ba f2 01 00 00       	mov    $0x1f2,%edx
8010214e:	ee                   	out    %al,(%dx)
8010214f:	ba f3 01 00 00       	mov    $0x1f3,%edx
80102154:	89 f0                	mov    %esi,%eax
80102156:	ee                   	out    %al,(%dx)

  idewait(0);
  outb(0x3f6, 0);  // generate interrupt
  outb(0x1f2, sector_per_block);  // number of sectors
  outb(0x1f3, sector & 0xff);
  outb(0x1f4, (sector >> 8) & 0xff);
80102157:	89 f0                	mov    %esi,%eax
80102159:	ba f4 01 00 00       	mov    $0x1f4,%edx
8010215e:	c1 f8 08             	sar    $0x8,%eax
80102161:	ee                   	out    %al,(%dx)
80102162:	ba f5 01 00 00       	mov    $0x1f5,%edx
80102167:	89 f8                	mov    %edi,%eax
80102169:	ee                   	out    %al,(%dx)
  outb(0x1f5, (sector >> 16) & 0xff);
  outb(0x1f6, 0xe0 | ((b->dev&1)<<4) | ((sector>>24)&0x0f));
8010216a:	0f b6 43 04          	movzbl 0x4(%ebx),%eax
8010216e:	ba f6 01 00 00       	mov    $0x1f6,%edx
80102173:	c1 e0 04             	shl    $0x4,%eax
80102176:	83 e0 10             	and    $0x10,%eax
80102179:	83 c8 e0             	or     $0xffffffe0,%eax
8010217c:	ee                   	out    %al,(%dx)
  if(b->flags & B_DIRTY){
8010217d:	f6 03 04             	testb  $0x4,(%ebx)
80102180:	75 16                	jne    80102198 <idestart+0x98>
80102182:	b8 20 00 00 00       	mov    $0x20,%eax
80102187:	89 ca                	mov    %ecx,%edx
80102189:	ee                   	out    %al,(%dx)
    outb(0x1f7, write_cmd);
    outsl(0x1f0, b->data, BSIZE/4);
  } else {
    outb(0x1f7, read_cmd);
  }
}
8010218a:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010218d:	5b                   	pop    %ebx
8010218e:	5e                   	pop    %esi
8010218f:	5f                   	pop    %edi
80102190:	5d                   	pop    %ebp
80102191:	c3                   	ret    
80102192:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80102198:	b8 30 00 00 00       	mov    $0x30,%eax
8010219d:	89 ca                	mov    %ecx,%edx
8010219f:	ee                   	out    %al,(%dx)
  asm volatile("cld; rep outsl" :
801021a0:	b9 80 00 00 00       	mov    $0x80,%ecx
    outsl(0x1f0, b->data, BSIZE/4);
801021a5:	8d 73 5c             	lea    0x5c(%ebx),%esi
801021a8:	ba f0 01 00 00       	mov    $0x1f0,%edx
801021ad:	fc                   	cld    
801021ae:	f3 6f                	rep outsl %ds:(%esi),(%dx)
}
801021b0:	8d 65 f4             	lea    -0xc(%ebp),%esp
801021b3:	5b                   	pop    %ebx
801021b4:	5e                   	pop    %esi
801021b5:	5f                   	pop    %edi
801021b6:	5d                   	pop    %ebp
801021b7:	c3                   	ret    
    panic("incorrect blockno");
801021b8:	83 ec 0c             	sub    $0xc,%esp
801021bb:	68 14 7b 10 80       	push   $0x80107b14
801021c0:	e8 bb e1 ff ff       	call   80100380 <panic>
    panic("idestart");
801021c5:	83 ec 0c             	sub    $0xc,%esp
801021c8:	68 0b 7b 10 80       	push   $0x80107b0b
801021cd:	e8 ae e1 ff ff       	call   80100380 <panic>
801021d2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801021d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801021e0 <ideinit>:
{
801021e0:	55                   	push   %ebp
801021e1:	89 e5                	mov    %esp,%ebp
801021e3:	83 ec 10             	sub    $0x10,%esp
  initlock(&idelock, "ide");
801021e6:	68 26 7b 10 80       	push   $0x80107b26
801021eb:	68 00 26 11 80       	push   $0x80112600
801021f0:	e8 9b 27 00 00       	call   80104990 <initlock>
  ioapicenable(IRQ_IDE, ncpu - 1);
801021f5:	58                   	pop    %eax
801021f6:	a1 84 27 11 80       	mov    0x80112784,%eax
801021fb:	5a                   	pop    %edx
801021fc:	83 e8 01             	sub    $0x1,%eax
801021ff:	50                   	push   %eax
80102200:	6a 0e                	push   $0xe
80102202:	e8 99 02 00 00       	call   801024a0 <ioapicenable>
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
80102207:	83 c4 10             	add    $0x10,%esp
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010220a:	ba f7 01 00 00       	mov    $0x1f7,%edx
8010220f:	90                   	nop
80102210:	ec                   	in     (%dx),%al
80102211:	83 e0 c0             	and    $0xffffffc0,%eax
80102214:	3c 40                	cmp    $0x40,%al
80102216:	75 f8                	jne    80102210 <ideinit+0x30>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102218:	b8 f0 ff ff ff       	mov    $0xfffffff0,%eax
8010221d:	ba f6 01 00 00       	mov    $0x1f6,%edx
80102222:	ee                   	out    %al,(%dx)
80102223:	b9 e8 03 00 00       	mov    $0x3e8,%ecx
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102228:	ba f7 01 00 00       	mov    $0x1f7,%edx
8010222d:	eb 06                	jmp    80102235 <ideinit+0x55>
8010222f:	90                   	nop
  for(i=0; i<1000; i++){
80102230:	83 e9 01             	sub    $0x1,%ecx
80102233:	74 0f                	je     80102244 <ideinit+0x64>
80102235:	ec                   	in     (%dx),%al
    if(inb(0x1f7) != 0){
80102236:	84 c0                	test   %al,%al
80102238:	74 f6                	je     80102230 <ideinit+0x50>
      havedisk1 = 1;
8010223a:	c7 05 e0 25 11 80 01 	movl   $0x1,0x801125e0
80102241:	00 00 00 
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102244:	b8 e0 ff ff ff       	mov    $0xffffffe0,%eax
80102249:	ba f6 01 00 00       	mov    $0x1f6,%edx
8010224e:	ee                   	out    %al,(%dx)
}
8010224f:	c9                   	leave  
80102250:	c3                   	ret    
80102251:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102258:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010225f:	90                   	nop

80102260 <ideintr>:

// Interrupt handler.
void
ideintr(void)
{
80102260:	55                   	push   %ebp
80102261:	89 e5                	mov    %esp,%ebp
80102263:	57                   	push   %edi
80102264:	56                   	push   %esi
80102265:	53                   	push   %ebx
80102266:	83 ec 18             	sub    $0x18,%esp
  struct buf *b;

  // First queued buffer is the active request.
  acquire(&idelock);
80102269:	68 00 26 11 80       	push   $0x80112600
8010226e:	e8 2d 28 00 00       	call   80104aa0 <acquire>

  if((b = idequeue) == 0){
80102273:	8b 1d e4 25 11 80    	mov    0x801125e4,%ebx
80102279:	83 c4 10             	add    $0x10,%esp
8010227c:	85 db                	test   %ebx,%ebx
8010227e:	74 63                	je     801022e3 <ideintr+0x83>
    release(&idelock);
    return;
  }
  idequeue = b->qnext;
80102280:	8b 43 58             	mov    0x58(%ebx),%eax
80102283:	a3 e4 25 11 80       	mov    %eax,0x801125e4

  // Read data if needed.
  if(!(b->flags & B_DIRTY) && idewait(1) >= 0)
80102288:	8b 33                	mov    (%ebx),%esi
8010228a:	f7 c6 04 00 00 00    	test   $0x4,%esi
80102290:	75 2f                	jne    801022c1 <ideintr+0x61>
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102292:	ba f7 01 00 00       	mov    $0x1f7,%edx
80102297:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010229e:	66 90                	xchg   %ax,%ax
801022a0:	ec                   	in     (%dx),%al
  while(((r = inb(0x1f7)) & (IDE_BSY|IDE_DRDY)) != IDE_DRDY)
801022a1:	89 c1                	mov    %eax,%ecx
801022a3:	83 e1 c0             	and    $0xffffffc0,%ecx
801022a6:	80 f9 40             	cmp    $0x40,%cl
801022a9:	75 f5                	jne    801022a0 <ideintr+0x40>
  if(checkerr && (r & (IDE_DF|IDE_ERR)) != 0)
801022ab:	a8 21                	test   $0x21,%al
801022ad:	75 12                	jne    801022c1 <ideintr+0x61>
    insl(0x1f0, b->data, BSIZE/4);
801022af:	8d 7b 5c             	lea    0x5c(%ebx),%edi
  asm volatile("cld; rep insl" :
801022b2:	b9 80 00 00 00       	mov    $0x80,%ecx
801022b7:	ba f0 01 00 00       	mov    $0x1f0,%edx
801022bc:	fc                   	cld    
801022bd:	f3 6d                	rep insl (%dx),%es:(%edi)

  // Wake process waiting for this buf.
  b->flags |= B_VALID;
801022bf:	8b 33                	mov    (%ebx),%esi
  b->flags &= ~B_DIRTY;
801022c1:	83 e6 fb             	and    $0xfffffffb,%esi
  wakeup(b);
801022c4:	83 ec 0c             	sub    $0xc,%esp
  b->flags &= ~B_DIRTY;
801022c7:	83 ce 02             	or     $0x2,%esi
801022ca:	89 33                	mov    %esi,(%ebx)
  wakeup(b);
801022cc:	53                   	push   %ebx
801022cd:	e8 ee 1f 00 00       	call   801042c0 <wakeup>

  // Start disk on next buf in queue.
  if(idequeue != 0)
801022d2:	a1 e4 25 11 80       	mov    0x801125e4,%eax
801022d7:	83 c4 10             	add    $0x10,%esp
801022da:	85 c0                	test   %eax,%eax
801022dc:	74 05                	je     801022e3 <ideintr+0x83>
    idestart(idequeue);
801022de:	e8 1d fe ff ff       	call   80102100 <idestart>
    release(&idelock);
801022e3:	83 ec 0c             	sub    $0xc,%esp
801022e6:	68 00 26 11 80       	push   $0x80112600
801022eb:	e8 d0 28 00 00       	call   80104bc0 <release>

  release(&idelock);
}
801022f0:	8d 65 f4             	lea    -0xc(%ebp),%esp
801022f3:	5b                   	pop    %ebx
801022f4:	5e                   	pop    %esi
801022f5:	5f                   	pop    %edi
801022f6:	5d                   	pop    %ebp
801022f7:	c3                   	ret    
801022f8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801022ff:	90                   	nop

80102300 <iderw>:
// Sync buf with disk.
// If B_DIRTY is set, write buf to disk, clear B_DIRTY, set B_VALID.
// Else if B_VALID is not set, read buf from disk, set B_VALID.
void
iderw(struct buf *b)
{
80102300:	55                   	push   %ebp
80102301:	89 e5                	mov    %esp,%ebp
80102303:	53                   	push   %ebx
80102304:	83 ec 10             	sub    $0x10,%esp
80102307:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct buf **pp;

  if(!holdingsleep(&b->lock))
8010230a:	8d 43 0c             	lea    0xc(%ebx),%eax
8010230d:	50                   	push   %eax
8010230e:	e8 4d 26 00 00       	call   80104960 <holdingsleep>
80102313:	83 c4 10             	add    $0x10,%esp
80102316:	85 c0                	test   %eax,%eax
80102318:	0f 84 c3 00 00 00    	je     801023e1 <iderw+0xe1>
    panic("iderw: buf not locked");
  if((b->flags & (B_VALID|B_DIRTY)) == B_VALID)
8010231e:	8b 03                	mov    (%ebx),%eax
80102320:	83 e0 06             	and    $0x6,%eax
80102323:	83 f8 02             	cmp    $0x2,%eax
80102326:	0f 84 a8 00 00 00    	je     801023d4 <iderw+0xd4>
    panic("iderw: nothing to do");
  if(b->dev != 0 && !havedisk1)
8010232c:	8b 53 04             	mov    0x4(%ebx),%edx
8010232f:	85 d2                	test   %edx,%edx
80102331:	74 0d                	je     80102340 <iderw+0x40>
80102333:	a1 e0 25 11 80       	mov    0x801125e0,%eax
80102338:	85 c0                	test   %eax,%eax
8010233a:	0f 84 87 00 00 00    	je     801023c7 <iderw+0xc7>
    panic("iderw: ide disk 1 not present");

  acquire(&idelock);  //DOC:acquire-lock
80102340:	83 ec 0c             	sub    $0xc,%esp
80102343:	68 00 26 11 80       	push   $0x80112600
80102348:	e8 53 27 00 00       	call   80104aa0 <acquire>

  // Append b to idequeue.
  b->qnext = 0;
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
8010234d:	a1 e4 25 11 80       	mov    0x801125e4,%eax
  b->qnext = 0;
80102352:	c7 43 58 00 00 00 00 	movl   $0x0,0x58(%ebx)
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
80102359:	83 c4 10             	add    $0x10,%esp
8010235c:	85 c0                	test   %eax,%eax
8010235e:	74 60                	je     801023c0 <iderw+0xc0>
80102360:	89 c2                	mov    %eax,%edx
80102362:	8b 40 58             	mov    0x58(%eax),%eax
80102365:	85 c0                	test   %eax,%eax
80102367:	75 f7                	jne    80102360 <iderw+0x60>
80102369:	83 c2 58             	add    $0x58,%edx
    ;
  *pp = b;
8010236c:	89 1a                	mov    %ebx,(%edx)

  // Start disk if necessary.
  if(idequeue == b)
8010236e:	39 1d e4 25 11 80    	cmp    %ebx,0x801125e4
80102374:	74 3a                	je     801023b0 <iderw+0xb0>
    idestart(b);

  // Wait for request to finish.
  while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
80102376:	8b 03                	mov    (%ebx),%eax
80102378:	83 e0 06             	and    $0x6,%eax
8010237b:	83 f8 02             	cmp    $0x2,%eax
8010237e:	74 1b                	je     8010239b <iderw+0x9b>
    sleep(b, &idelock);
80102380:	83 ec 08             	sub    $0x8,%esp
80102383:	68 00 26 11 80       	push   $0x80112600
80102388:	53                   	push   %ebx
80102389:	e8 72 1e 00 00       	call   80104200 <sleep>
  while((b->flags & (B_VALID|B_DIRTY)) != B_VALID){
8010238e:	8b 03                	mov    (%ebx),%eax
80102390:	83 c4 10             	add    $0x10,%esp
80102393:	83 e0 06             	and    $0x6,%eax
80102396:	83 f8 02             	cmp    $0x2,%eax
80102399:	75 e5                	jne    80102380 <iderw+0x80>
  }


  release(&idelock);
8010239b:	c7 45 08 00 26 11 80 	movl   $0x80112600,0x8(%ebp)
}
801023a2:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801023a5:	c9                   	leave  
  release(&idelock);
801023a6:	e9 15 28 00 00       	jmp    80104bc0 <release>
801023ab:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801023af:	90                   	nop
    idestart(b);
801023b0:	89 d8                	mov    %ebx,%eax
801023b2:	e8 49 fd ff ff       	call   80102100 <idestart>
801023b7:	eb bd                	jmp    80102376 <iderw+0x76>
801023b9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  for(pp=&idequeue; *pp; pp=&(*pp)->qnext)  //DOC:insert-queue
801023c0:	ba e4 25 11 80       	mov    $0x801125e4,%edx
801023c5:	eb a5                	jmp    8010236c <iderw+0x6c>
    panic("iderw: ide disk 1 not present");
801023c7:	83 ec 0c             	sub    $0xc,%esp
801023ca:	68 55 7b 10 80       	push   $0x80107b55
801023cf:	e8 ac df ff ff       	call   80100380 <panic>
    panic("iderw: nothing to do");
801023d4:	83 ec 0c             	sub    $0xc,%esp
801023d7:	68 40 7b 10 80       	push   $0x80107b40
801023dc:	e8 9f df ff ff       	call   80100380 <panic>
    panic("iderw: buf not locked");
801023e1:	83 ec 0c             	sub    $0xc,%esp
801023e4:	68 2a 7b 10 80       	push   $0x80107b2a
801023e9:	e8 92 df ff ff       	call   80100380 <panic>
801023ee:	66 90                	xchg   %ax,%ax

801023f0 <ioapicinit>:
  ioapic->data = data;
}

void
ioapicinit(void)
{
801023f0:	55                   	push   %ebp
  int i, id, maxintr;

  ioapic = (volatile struct ioapic*)IOAPIC;
801023f1:	c7 05 34 26 11 80 00 	movl   $0xfec00000,0x80112634
801023f8:	00 c0 fe 
{
801023fb:	89 e5                	mov    %esp,%ebp
801023fd:	56                   	push   %esi
801023fe:	53                   	push   %ebx
  ioapic->reg = reg;
801023ff:	c7 05 00 00 c0 fe 01 	movl   $0x1,0xfec00000
80102406:	00 00 00 
  return ioapic->data;
80102409:	8b 15 34 26 11 80    	mov    0x80112634,%edx
8010240f:	8b 72 10             	mov    0x10(%edx),%esi
  ioapic->reg = reg;
80102412:	c7 02 00 00 00 00    	movl   $0x0,(%edx)
  return ioapic->data;
80102418:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
  maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
  id = ioapicread(REG_ID) >> 24;
  if(id != ioapicid)
8010241e:	0f b6 15 80 27 11 80 	movzbl 0x80112780,%edx
  maxintr = (ioapicread(REG_VER) >> 16) & 0xFF;
80102425:	c1 ee 10             	shr    $0x10,%esi
80102428:	89 f0                	mov    %esi,%eax
8010242a:	0f b6 f0             	movzbl %al,%esi
  return ioapic->data;
8010242d:	8b 41 10             	mov    0x10(%ecx),%eax
  id = ioapicread(REG_ID) >> 24;
80102430:	c1 e8 18             	shr    $0x18,%eax
  if(id != ioapicid)
80102433:	39 c2                	cmp    %eax,%edx
80102435:	74 16                	je     8010244d <ioapicinit+0x5d>
    cprintf("ioapicinit: id isn't equal to ioapicid; not a MP\n");
80102437:	83 ec 0c             	sub    $0xc,%esp
8010243a:	68 74 7b 10 80       	push   $0x80107b74
8010243f:	e8 5c e2 ff ff       	call   801006a0 <cprintf>
  ioapic->reg = reg;
80102444:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
8010244a:	83 c4 10             	add    $0x10,%esp
8010244d:	83 c6 21             	add    $0x21,%esi
{
80102450:	ba 10 00 00 00       	mov    $0x10,%edx
80102455:	b8 20 00 00 00       	mov    $0x20,%eax
8010245a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  ioapic->reg = reg;
80102460:	89 11                	mov    %edx,(%ecx)

  // Mark all interrupts edge-triggered, active high, disabled,
  // and not routed to any CPUs.
  for(i = 0; i <= maxintr; i++){
    ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
80102462:	89 c3                	mov    %eax,%ebx
  ioapic->data = data;
80102464:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
  for(i = 0; i <= maxintr; i++){
8010246a:	83 c0 01             	add    $0x1,%eax
    ioapicwrite(REG_TABLE+2*i, INT_DISABLED | (T_IRQ0 + i));
8010246d:	81 cb 00 00 01 00    	or     $0x10000,%ebx
  ioapic->data = data;
80102473:	89 59 10             	mov    %ebx,0x10(%ecx)
  ioapic->reg = reg;
80102476:	8d 5a 01             	lea    0x1(%edx),%ebx
  for(i = 0; i <= maxintr; i++){
80102479:	83 c2 02             	add    $0x2,%edx
  ioapic->reg = reg;
8010247c:	89 19                	mov    %ebx,(%ecx)
  ioapic->data = data;
8010247e:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
80102484:	c7 41 10 00 00 00 00 	movl   $0x0,0x10(%ecx)
  for(i = 0; i <= maxintr; i++){
8010248b:	39 f0                	cmp    %esi,%eax
8010248d:	75 d1                	jne    80102460 <ioapicinit+0x70>
    ioapicwrite(REG_TABLE+2*i+1, 0);
  }
}
8010248f:	8d 65 f8             	lea    -0x8(%ebp),%esp
80102492:	5b                   	pop    %ebx
80102493:	5e                   	pop    %esi
80102494:	5d                   	pop    %ebp
80102495:	c3                   	ret    
80102496:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010249d:	8d 76 00             	lea    0x0(%esi),%esi

801024a0 <ioapicenable>:

void
ioapicenable(int irq, int cpunum)
{
801024a0:	55                   	push   %ebp
  ioapic->reg = reg;
801024a1:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
{
801024a7:	89 e5                	mov    %esp,%ebp
801024a9:	8b 45 08             	mov    0x8(%ebp),%eax
  // Mark interrupt edge-triggered, active high,
  // enabled, and routed to the given cpunum,
  // which happens to be that cpu's APIC ID.
  ioapicwrite(REG_TABLE+2*irq, T_IRQ0 + irq);
801024ac:	8d 50 20             	lea    0x20(%eax),%edx
801024af:	8d 44 00 10          	lea    0x10(%eax,%eax,1),%eax
  ioapic->reg = reg;
801024b3:	89 01                	mov    %eax,(%ecx)
  ioapic->data = data;
801024b5:	8b 0d 34 26 11 80    	mov    0x80112634,%ecx
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801024bb:	83 c0 01             	add    $0x1,%eax
  ioapic->data = data;
801024be:	89 51 10             	mov    %edx,0x10(%ecx)
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801024c1:	8b 55 0c             	mov    0xc(%ebp),%edx
  ioapic->reg = reg;
801024c4:	89 01                	mov    %eax,(%ecx)
  ioapic->data = data;
801024c6:	a1 34 26 11 80       	mov    0x80112634,%eax
  ioapicwrite(REG_TABLE+2*irq+1, cpunum << 24);
801024cb:	c1 e2 18             	shl    $0x18,%edx
  ioapic->data = data;
801024ce:	89 50 10             	mov    %edx,0x10(%eax)
}
801024d1:	5d                   	pop    %ebp
801024d2:	c3                   	ret    
801024d3:	66 90                	xchg   %ax,%ax
801024d5:	66 90                	xchg   %ax,%ax
801024d7:	66 90                	xchg   %ax,%ax
801024d9:	66 90                	xchg   %ax,%ax
801024db:	66 90                	xchg   %ax,%ax
801024dd:	66 90                	xchg   %ax,%ax
801024df:	90                   	nop

801024e0 <kfree>:
// which normally should have been returned by a
// call to kalloc().  (The exception is when
// initializing the allocator; see kinit above.)
void
kfree(char *v)
{
801024e0:	55                   	push   %ebp
801024e1:	89 e5                	mov    %esp,%ebp
801024e3:	53                   	push   %ebx
801024e4:	83 ec 04             	sub    $0x4,%esp
801024e7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct run *r;

  if((uint)v % PGSIZE || v < end || V2P(v) >= PHYSTOP)
801024ea:	f7 c3 ff 0f 00 00    	test   $0xfff,%ebx
801024f0:	75 76                	jne    80102568 <kfree+0x88>
801024f2:	81 fb d0 e6 11 80    	cmp    $0x8011e6d0,%ebx
801024f8:	72 6e                	jb     80102568 <kfree+0x88>
801024fa:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80102500:	3d ff ff ff 0d       	cmp    $0xdffffff,%eax
80102505:	77 61                	ja     80102568 <kfree+0x88>
    panic("kfree");

  // Fill with junk to catch dangling refs.
  memset(v, 1, PGSIZE);
80102507:	83 ec 04             	sub    $0x4,%esp
8010250a:	68 00 10 00 00       	push   $0x1000
8010250f:	6a 01                	push   $0x1
80102511:	53                   	push   %ebx
80102512:	e8 f9 26 00 00       	call   80104c10 <memset>

  if(kmem.use_lock)
80102517:	8b 15 74 26 11 80    	mov    0x80112674,%edx
8010251d:	83 c4 10             	add    $0x10,%esp
80102520:	85 d2                	test   %edx,%edx
80102522:	75 1c                	jne    80102540 <kfree+0x60>
    acquire(&kmem.lock);
  r = (struct run*)v;
  r->next = kmem.freelist;
80102524:	a1 78 26 11 80       	mov    0x80112678,%eax
80102529:	89 03                	mov    %eax,(%ebx)
  kmem.freelist = r;
  if(kmem.use_lock)
8010252b:	a1 74 26 11 80       	mov    0x80112674,%eax
  kmem.freelist = r;
80102530:	89 1d 78 26 11 80    	mov    %ebx,0x80112678
  if(kmem.use_lock)
80102536:	85 c0                	test   %eax,%eax
80102538:	75 1e                	jne    80102558 <kfree+0x78>
    release(&kmem.lock);
}
8010253a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010253d:	c9                   	leave  
8010253e:	c3                   	ret    
8010253f:	90                   	nop
    acquire(&kmem.lock);
80102540:	83 ec 0c             	sub    $0xc,%esp
80102543:	68 40 26 11 80       	push   $0x80112640
80102548:	e8 53 25 00 00       	call   80104aa0 <acquire>
8010254d:	83 c4 10             	add    $0x10,%esp
80102550:	eb d2                	jmp    80102524 <kfree+0x44>
80102552:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    release(&kmem.lock);
80102558:	c7 45 08 40 26 11 80 	movl   $0x80112640,0x8(%ebp)
}
8010255f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80102562:	c9                   	leave  
    release(&kmem.lock);
80102563:	e9 58 26 00 00       	jmp    80104bc0 <release>
    panic("kfree");
80102568:	83 ec 0c             	sub    $0xc,%esp
8010256b:	68 a6 7b 10 80       	push   $0x80107ba6
80102570:	e8 0b de ff ff       	call   80100380 <panic>
80102575:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010257c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80102580 <freerange>:
{
80102580:	55                   	push   %ebp
80102581:	89 e5                	mov    %esp,%ebp
80102583:	56                   	push   %esi
  p = (char*)PGROUNDUP((uint)vstart);
80102584:	8b 45 08             	mov    0x8(%ebp),%eax
{
80102587:	8b 75 0c             	mov    0xc(%ebp),%esi
8010258a:	53                   	push   %ebx
  p = (char*)PGROUNDUP((uint)vstart);
8010258b:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
80102591:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102597:	81 c3 00 10 00 00    	add    $0x1000,%ebx
8010259d:	39 de                	cmp    %ebx,%esi
8010259f:	72 23                	jb     801025c4 <freerange+0x44>
801025a1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    kfree(p);
801025a8:	83 ec 0c             	sub    $0xc,%esp
801025ab:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801025b1:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
801025b7:	50                   	push   %eax
801025b8:	e8 23 ff ff ff       	call   801024e0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801025bd:	83 c4 10             	add    $0x10,%esp
801025c0:	39 f3                	cmp    %esi,%ebx
801025c2:	76 e4                	jbe    801025a8 <freerange+0x28>
}
801025c4:	8d 65 f8             	lea    -0x8(%ebp),%esp
801025c7:	5b                   	pop    %ebx
801025c8:	5e                   	pop    %esi
801025c9:	5d                   	pop    %ebp
801025ca:	c3                   	ret    
801025cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801025cf:	90                   	nop

801025d0 <kinit2>:
{
801025d0:	55                   	push   %ebp
801025d1:	89 e5                	mov    %esp,%ebp
801025d3:	56                   	push   %esi
  p = (char*)PGROUNDUP((uint)vstart);
801025d4:	8b 45 08             	mov    0x8(%ebp),%eax
{
801025d7:	8b 75 0c             	mov    0xc(%ebp),%esi
801025da:	53                   	push   %ebx
  p = (char*)PGROUNDUP((uint)vstart);
801025db:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
801025e1:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
801025e7:	81 c3 00 10 00 00    	add    $0x1000,%ebx
801025ed:	39 de                	cmp    %ebx,%esi
801025ef:	72 23                	jb     80102614 <kinit2+0x44>
801025f1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    kfree(p);
801025f8:	83 ec 0c             	sub    $0xc,%esp
801025fb:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102601:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
80102607:	50                   	push   %eax
80102608:	e8 d3 fe ff ff       	call   801024e0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010260d:	83 c4 10             	add    $0x10,%esp
80102610:	39 de                	cmp    %ebx,%esi
80102612:	73 e4                	jae    801025f8 <kinit2+0x28>
  kmem.use_lock = 1;
80102614:	c7 05 74 26 11 80 01 	movl   $0x1,0x80112674
8010261b:	00 00 00 
}
8010261e:	8d 65 f8             	lea    -0x8(%ebp),%esp
80102621:	5b                   	pop    %ebx
80102622:	5e                   	pop    %esi
80102623:	5d                   	pop    %ebp
80102624:	c3                   	ret    
80102625:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010262c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80102630 <kinit1>:
{
80102630:	55                   	push   %ebp
80102631:	89 e5                	mov    %esp,%ebp
80102633:	56                   	push   %esi
80102634:	53                   	push   %ebx
80102635:	8b 75 0c             	mov    0xc(%ebp),%esi
  initlock(&kmem.lock, "kmem");
80102638:	83 ec 08             	sub    $0x8,%esp
8010263b:	68 ac 7b 10 80       	push   $0x80107bac
80102640:	68 40 26 11 80       	push   $0x80112640
80102645:	e8 46 23 00 00       	call   80104990 <initlock>
  p = (char*)PGROUNDUP((uint)vstart);
8010264a:	8b 45 08             	mov    0x8(%ebp),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
8010264d:	83 c4 10             	add    $0x10,%esp
  kmem.use_lock = 0;
80102650:	c7 05 74 26 11 80 00 	movl   $0x0,0x80112674
80102657:	00 00 00 
  p = (char*)PGROUNDUP((uint)vstart);
8010265a:	8d 98 ff 0f 00 00    	lea    0xfff(%eax),%ebx
80102660:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102666:	81 c3 00 10 00 00    	add    $0x1000,%ebx
8010266c:	39 de                	cmp    %ebx,%esi
8010266e:	72 1c                	jb     8010268c <kinit1+0x5c>
    kfree(p);
80102670:	83 ec 0c             	sub    $0xc,%esp
80102673:	8d 83 00 f0 ff ff    	lea    -0x1000(%ebx),%eax
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102679:	81 c3 00 10 00 00    	add    $0x1000,%ebx
    kfree(p);
8010267f:	50                   	push   %eax
80102680:	e8 5b fe ff ff       	call   801024e0 <kfree>
  for(; p + PGSIZE <= (char*)vend; p += PGSIZE)
80102685:	83 c4 10             	add    $0x10,%esp
80102688:	39 de                	cmp    %ebx,%esi
8010268a:	73 e4                	jae    80102670 <kinit1+0x40>
}
8010268c:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010268f:	5b                   	pop    %ebx
80102690:	5e                   	pop    %esi
80102691:	5d                   	pop    %ebp
80102692:	c3                   	ret    
80102693:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010269a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801026a0 <kalloc>:
char*
kalloc(void)
{
  struct run *r;

  if(kmem.use_lock)
801026a0:	a1 74 26 11 80       	mov    0x80112674,%eax
801026a5:	85 c0                	test   %eax,%eax
801026a7:	75 1f                	jne    801026c8 <kalloc+0x28>
    acquire(&kmem.lock);
  r = kmem.freelist;
801026a9:	a1 78 26 11 80       	mov    0x80112678,%eax
  if(r)
801026ae:	85 c0                	test   %eax,%eax
801026b0:	74 0e                	je     801026c0 <kalloc+0x20>
    kmem.freelist = r->next;
801026b2:	8b 10                	mov    (%eax),%edx
801026b4:	89 15 78 26 11 80    	mov    %edx,0x80112678
  if(kmem.use_lock)
801026ba:	c3                   	ret    
801026bb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801026bf:	90                   	nop
    release(&kmem.lock);
  return (char*)r;
}
801026c0:	c3                   	ret    
801026c1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
{
801026c8:	55                   	push   %ebp
801026c9:	89 e5                	mov    %esp,%ebp
801026cb:	83 ec 24             	sub    $0x24,%esp
    acquire(&kmem.lock);
801026ce:	68 40 26 11 80       	push   $0x80112640
801026d3:	e8 c8 23 00 00       	call   80104aa0 <acquire>
  r = kmem.freelist;
801026d8:	a1 78 26 11 80       	mov    0x80112678,%eax
  if(kmem.use_lock)
801026dd:	8b 15 74 26 11 80    	mov    0x80112674,%edx
  if(r)
801026e3:	83 c4 10             	add    $0x10,%esp
801026e6:	85 c0                	test   %eax,%eax
801026e8:	74 08                	je     801026f2 <kalloc+0x52>
    kmem.freelist = r->next;
801026ea:	8b 08                	mov    (%eax),%ecx
801026ec:	89 0d 78 26 11 80    	mov    %ecx,0x80112678
  if(kmem.use_lock)
801026f2:	85 d2                	test   %edx,%edx
801026f4:	74 16                	je     8010270c <kalloc+0x6c>
    release(&kmem.lock);
801026f6:	83 ec 0c             	sub    $0xc,%esp
801026f9:	89 45 f4             	mov    %eax,-0xc(%ebp)
801026fc:	68 40 26 11 80       	push   $0x80112640
80102701:	e8 ba 24 00 00       	call   80104bc0 <release>
  return (char*)r;
80102706:	8b 45 f4             	mov    -0xc(%ebp),%eax
    release(&kmem.lock);
80102709:	83 c4 10             	add    $0x10,%esp
}
8010270c:	c9                   	leave  
8010270d:	c3                   	ret    
8010270e:	66 90                	xchg   %ax,%ax

80102710 <kbdgetc>:
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102710:	ba 64 00 00 00       	mov    $0x64,%edx
80102715:	ec                   	in     (%dx),%al
    normalmap, shiftmap, ctlmap, ctlmap
  };
  uint st, data, c;

  st = inb(KBSTATP);
  if((st & KBS_DIB) == 0)
80102716:	a8 01                	test   $0x1,%al
80102718:	0f 84 c2 00 00 00    	je     801027e0 <kbdgetc+0xd0>
{
8010271e:	55                   	push   %ebp
8010271f:	ba 60 00 00 00       	mov    $0x60,%edx
80102724:	89 e5                	mov    %esp,%ebp
80102726:	53                   	push   %ebx
80102727:	ec                   	in     (%dx),%al
    return -1;
  data = inb(KBDATAP);

  if(data == 0xE0){
    shift |= E0ESC;
80102728:	8b 1d 7c 26 11 80    	mov    0x8011267c,%ebx
  data = inb(KBDATAP);
8010272e:	0f b6 c8             	movzbl %al,%ecx
  if(data == 0xE0){
80102731:	3c e0                	cmp    $0xe0,%al
80102733:	74 5b                	je     80102790 <kbdgetc+0x80>
    return 0;
  } else if(data & 0x80){
    // Key released
    data = (shift & E0ESC ? data : data & 0x7F);
80102735:	89 da                	mov    %ebx,%edx
80102737:	83 e2 40             	and    $0x40,%edx
  } else if(data & 0x80){
8010273a:	84 c0                	test   %al,%al
8010273c:	78 62                	js     801027a0 <kbdgetc+0x90>
    shift &= ~(shiftcode[data] | E0ESC);
    return 0;
  } else if(shift & E0ESC){
8010273e:	85 d2                	test   %edx,%edx
80102740:	74 09                	je     8010274b <kbdgetc+0x3b>
    // Last character was an E0 escape; or with 0x80
    data |= 0x80;
80102742:	83 c8 80             	or     $0xffffff80,%eax
    shift &= ~E0ESC;
80102745:	83 e3 bf             	and    $0xffffffbf,%ebx
    data |= 0x80;
80102748:	0f b6 c8             	movzbl %al,%ecx
  }

  shift |= shiftcode[data];
8010274b:	0f b6 91 e0 7c 10 80 	movzbl -0x7fef8320(%ecx),%edx
  shift ^= togglecode[data];
80102752:	0f b6 81 e0 7b 10 80 	movzbl -0x7fef8420(%ecx),%eax
  shift |= shiftcode[data];
80102759:	09 da                	or     %ebx,%edx
  shift ^= togglecode[data];
8010275b:	31 c2                	xor    %eax,%edx
  c = charcode[shift & (CTL | SHIFT)][data];
8010275d:	89 d0                	mov    %edx,%eax
  shift ^= togglecode[data];
8010275f:	89 15 7c 26 11 80    	mov    %edx,0x8011267c
  c = charcode[shift & (CTL | SHIFT)][data];
80102765:	83 e0 03             	and    $0x3,%eax
  if(shift & CAPSLOCK){
80102768:	83 e2 08             	and    $0x8,%edx
  c = charcode[shift & (CTL | SHIFT)][data];
8010276b:	8b 04 85 c0 7b 10 80 	mov    -0x7fef8440(,%eax,4),%eax
80102772:	0f b6 04 08          	movzbl (%eax,%ecx,1),%eax
  if(shift & CAPSLOCK){
80102776:	74 0b                	je     80102783 <kbdgetc+0x73>
    if('a' <= c && c <= 'z')
80102778:	8d 50 9f             	lea    -0x61(%eax),%edx
8010277b:	83 fa 19             	cmp    $0x19,%edx
8010277e:	77 48                	ja     801027c8 <kbdgetc+0xb8>
      c += 'A' - 'a';
80102780:	83 e8 20             	sub    $0x20,%eax
    else if('A' <= c && c <= 'Z')
      c += 'a' - 'A';
  }
  return c;
}
80102783:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80102786:	c9                   	leave  
80102787:	c3                   	ret    
80102788:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010278f:	90                   	nop
    shift |= E0ESC;
80102790:	83 cb 40             	or     $0x40,%ebx
    return 0;
80102793:	31 c0                	xor    %eax,%eax
    shift |= E0ESC;
80102795:	89 1d 7c 26 11 80    	mov    %ebx,0x8011267c
}
8010279b:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010279e:	c9                   	leave  
8010279f:	c3                   	ret    
    data = (shift & E0ESC ? data : data & 0x7F);
801027a0:	83 e0 7f             	and    $0x7f,%eax
801027a3:	85 d2                	test   %edx,%edx
801027a5:	0f 44 c8             	cmove  %eax,%ecx
    shift &= ~(shiftcode[data] | E0ESC);
801027a8:	0f b6 81 e0 7c 10 80 	movzbl -0x7fef8320(%ecx),%eax
801027af:	83 c8 40             	or     $0x40,%eax
801027b2:	0f b6 c0             	movzbl %al,%eax
801027b5:	f7 d0                	not    %eax
801027b7:	21 d8                	and    %ebx,%eax
}
801027b9:	8b 5d fc             	mov    -0x4(%ebp),%ebx
    shift &= ~(shiftcode[data] | E0ESC);
801027bc:	a3 7c 26 11 80       	mov    %eax,0x8011267c
    return 0;
801027c1:	31 c0                	xor    %eax,%eax
}
801027c3:	c9                   	leave  
801027c4:	c3                   	ret    
801027c5:	8d 76 00             	lea    0x0(%esi),%esi
    else if('A' <= c && c <= 'Z')
801027c8:	8d 48 bf             	lea    -0x41(%eax),%ecx
      c += 'a' - 'A';
801027cb:	8d 50 20             	lea    0x20(%eax),%edx
}
801027ce:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801027d1:	c9                   	leave  
      c += 'a' - 'A';
801027d2:	83 f9 1a             	cmp    $0x1a,%ecx
801027d5:	0f 42 c2             	cmovb  %edx,%eax
}
801027d8:	c3                   	ret    
801027d9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    return -1;
801027e0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801027e5:	c3                   	ret    
801027e6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801027ed:	8d 76 00             	lea    0x0(%esi),%esi

801027f0 <kbdintr>:

void
kbdintr(void)
{
801027f0:	55                   	push   %ebp
801027f1:	89 e5                	mov    %esp,%ebp
801027f3:	83 ec 14             	sub    $0x14,%esp
  consoleintr(kbdgetc);
801027f6:	68 10 27 10 80       	push   $0x80102710
801027fb:	e8 80 e0 ff ff       	call   80100880 <consoleintr>
}
80102800:	83 c4 10             	add    $0x10,%esp
80102803:	c9                   	leave  
80102804:	c3                   	ret    
80102805:	66 90                	xchg   %ax,%ax
80102807:	66 90                	xchg   %ax,%ax
80102809:	66 90                	xchg   %ax,%ax
8010280b:	66 90                	xchg   %ax,%ax
8010280d:	66 90                	xchg   %ax,%ax
8010280f:	90                   	nop

80102810 <lapicinit>:
}

void
lapicinit(void)
{
  if(!lapic)
80102810:	a1 80 26 11 80       	mov    0x80112680,%eax
80102815:	85 c0                	test   %eax,%eax
80102817:	0f 84 cb 00 00 00    	je     801028e8 <lapicinit+0xd8>
  lapic[index] = value;
8010281d:	c7 80 f0 00 00 00 3f 	movl   $0x13f,0xf0(%eax)
80102824:	01 00 00 
  lapic[ID];  // wait for write to finish, by reading
80102827:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
8010282a:	c7 80 e0 03 00 00 0b 	movl   $0xb,0x3e0(%eax)
80102831:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80102834:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80102837:	c7 80 20 03 00 00 20 	movl   $0x20020,0x320(%eax)
8010283e:	00 02 00 
  lapic[ID];  // wait for write to finish, by reading
80102841:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80102844:	c7 80 80 03 00 00 80 	movl   $0x989680,0x380(%eax)
8010284b:	96 98 00 
  lapic[ID];  // wait for write to finish, by reading
8010284e:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80102851:	c7 80 50 03 00 00 00 	movl   $0x10000,0x350(%eax)
80102858:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
8010285b:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
8010285e:	c7 80 60 03 00 00 00 	movl   $0x10000,0x360(%eax)
80102865:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
80102868:	8b 50 20             	mov    0x20(%eax),%edx
  lapicw(LINT0, MASKED);
  lapicw(LINT1, MASKED);

  // Disable performance counter overflow interrupts
  // on machines that provide that interrupt entry.
  if(((lapic[VER]>>16) & 0xFF) >= 4)
8010286b:	8b 50 30             	mov    0x30(%eax),%edx
8010286e:	c1 ea 10             	shr    $0x10,%edx
80102871:	81 e2 fc 00 00 00    	and    $0xfc,%edx
80102877:	75 77                	jne    801028f0 <lapicinit+0xe0>
  lapic[index] = value;
80102879:	c7 80 70 03 00 00 33 	movl   $0x33,0x370(%eax)
80102880:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80102883:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80102886:	c7 80 80 02 00 00 00 	movl   $0x0,0x280(%eax)
8010288d:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80102890:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
80102893:	c7 80 80 02 00 00 00 	movl   $0x0,0x280(%eax)
8010289a:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
8010289d:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801028a0:	c7 80 b0 00 00 00 00 	movl   $0x0,0xb0(%eax)
801028a7:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
801028aa:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801028ad:	c7 80 10 03 00 00 00 	movl   $0x0,0x310(%eax)
801028b4:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
801028b7:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801028ba:	c7 80 00 03 00 00 00 	movl   $0x88500,0x300(%eax)
801028c1:	85 08 00 
  lapic[ID];  // wait for write to finish, by reading
801028c4:	8b 50 20             	mov    0x20(%eax),%edx
801028c7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801028ce:	66 90                	xchg   %ax,%ax
  lapicw(EOI, 0);

  // Send an Init Level De-Assert to synchronise arbitration ID's.
  lapicw(ICRHI, 0);
  lapicw(ICRLO, BCAST | INIT | LEVEL);
  while(lapic[ICRLO] & DELIVS)
801028d0:	8b 90 00 03 00 00    	mov    0x300(%eax),%edx
801028d6:	80 e6 10             	and    $0x10,%dh
801028d9:	75 f5                	jne    801028d0 <lapicinit+0xc0>
  lapic[index] = value;
801028db:	c7 80 80 00 00 00 00 	movl   $0x0,0x80(%eax)
801028e2:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
801028e5:	8b 40 20             	mov    0x20(%eax),%eax
    ;

  // Enable interrupts on the APIC (but not on the processor).
  lapicw(TPR, 0);
}
801028e8:	c3                   	ret    
801028e9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  lapic[index] = value;
801028f0:	c7 80 40 03 00 00 00 	movl   $0x10000,0x340(%eax)
801028f7:	00 01 00 
  lapic[ID];  // wait for write to finish, by reading
801028fa:	8b 50 20             	mov    0x20(%eax),%edx
}
801028fd:	e9 77 ff ff ff       	jmp    80102879 <lapicinit+0x69>
80102902:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102909:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102910 <lapicid>:

int
lapicid(void)
{
  if (!lapic)
80102910:	a1 80 26 11 80       	mov    0x80112680,%eax
80102915:	85 c0                	test   %eax,%eax
80102917:	74 07                	je     80102920 <lapicid+0x10>
    return 0;
  return lapic[ID] >> 24;
80102919:	8b 40 20             	mov    0x20(%eax),%eax
8010291c:	c1 e8 18             	shr    $0x18,%eax
8010291f:	c3                   	ret    
    return 0;
80102920:	31 c0                	xor    %eax,%eax
}
80102922:	c3                   	ret    
80102923:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010292a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80102930 <lapiceoi>:

// Acknowledge interrupt.
void
lapiceoi(void)
{
  if(lapic)
80102930:	a1 80 26 11 80       	mov    0x80112680,%eax
80102935:	85 c0                	test   %eax,%eax
80102937:	74 0d                	je     80102946 <lapiceoi+0x16>
  lapic[index] = value;
80102939:	c7 80 b0 00 00 00 00 	movl   $0x0,0xb0(%eax)
80102940:	00 00 00 
  lapic[ID];  // wait for write to finish, by reading
80102943:	8b 40 20             	mov    0x20(%eax),%eax
    lapicw(EOI, 0);
}
80102946:	c3                   	ret    
80102947:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010294e:	66 90                	xchg   %ax,%ax

80102950 <microdelay>:
// Spin for a given number of microseconds.
// On real hardware would want to tune this dynamically.
void
microdelay(int us)
{
}
80102950:	c3                   	ret    
80102951:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102958:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010295f:	90                   	nop

80102960 <lapicstartap>:

// Start additional processor running entry code at addr.
// See Appendix B of MultiProcessor Specification.
void
lapicstartap(uchar apicid, uint addr)
{
80102960:	55                   	push   %ebp
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102961:	b8 0f 00 00 00       	mov    $0xf,%eax
80102966:	ba 70 00 00 00       	mov    $0x70,%edx
8010296b:	89 e5                	mov    %esp,%ebp
8010296d:	53                   	push   %ebx
8010296e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
80102971:	8b 5d 08             	mov    0x8(%ebp),%ebx
80102974:	ee                   	out    %al,(%dx)
80102975:	b8 0a 00 00 00       	mov    $0xa,%eax
8010297a:	ba 71 00 00 00       	mov    $0x71,%edx
8010297f:	ee                   	out    %al,(%dx)
  // and the warm reset vector (DWORD based at 40:67) to point at
  // the AP startup code prior to the [universal startup algorithm]."
  outb(CMOS_PORT, 0xF);  // offset 0xF is shutdown code
  outb(CMOS_PORT+1, 0x0A);
  wrv = (ushort*)P2V((0x40<<4 | 0x67));  // Warm reset vector
  wrv[0] = 0;
80102980:	31 c0                	xor    %eax,%eax
  wrv[1] = addr >> 4;

  // "Universal startup algorithm."
  // Send INIT (level-triggered) interrupt to reset other CPU.
  lapicw(ICRHI, apicid<<24);
80102982:	c1 e3 18             	shl    $0x18,%ebx
  wrv[0] = 0;
80102985:	66 a3 67 04 00 80    	mov    %ax,0x80000467
  wrv[1] = addr >> 4;
8010298b:	89 c8                	mov    %ecx,%eax
  // when it is in the halted state due to an INIT.  So the second
  // should be ignored, but it is part of the official Intel algorithm.
  // Bochs complains about the second one.  Too bad for Bochs.
  for(i = 0; i < 2; i++){
    lapicw(ICRHI, apicid<<24);
    lapicw(ICRLO, STARTUP | (addr>>12));
8010298d:	c1 e9 0c             	shr    $0xc,%ecx
  lapicw(ICRHI, apicid<<24);
80102990:	89 da                	mov    %ebx,%edx
  wrv[1] = addr >> 4;
80102992:	c1 e8 04             	shr    $0x4,%eax
    lapicw(ICRLO, STARTUP | (addr>>12));
80102995:	80 cd 06             	or     $0x6,%ch
  wrv[1] = addr >> 4;
80102998:	66 a3 69 04 00 80    	mov    %ax,0x80000469
  lapic[index] = value;
8010299e:	a1 80 26 11 80       	mov    0x80112680,%eax
801029a3:	89 98 10 03 00 00    	mov    %ebx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
801029a9:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
801029ac:	c7 80 00 03 00 00 00 	movl   $0xc500,0x300(%eax)
801029b3:	c5 00 00 
  lapic[ID];  // wait for write to finish, by reading
801029b6:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
801029b9:	c7 80 00 03 00 00 00 	movl   $0x8500,0x300(%eax)
801029c0:	85 00 00 
  lapic[ID];  // wait for write to finish, by reading
801029c3:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
801029c6:	89 90 10 03 00 00    	mov    %edx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
801029cc:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
801029cf:	89 88 00 03 00 00    	mov    %ecx,0x300(%eax)
  lapic[ID];  // wait for write to finish, by reading
801029d5:	8b 58 20             	mov    0x20(%eax),%ebx
  lapic[index] = value;
801029d8:	89 90 10 03 00 00    	mov    %edx,0x310(%eax)
  lapic[ID];  // wait for write to finish, by reading
801029de:	8b 50 20             	mov    0x20(%eax),%edx
  lapic[index] = value;
801029e1:	89 88 00 03 00 00    	mov    %ecx,0x300(%eax)
  lapic[ID];  // wait for write to finish, by reading
801029e7:	8b 40 20             	mov    0x20(%eax),%eax
    microdelay(200);
  }
}
801029ea:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801029ed:	c9                   	leave  
801029ee:	c3                   	ret    
801029ef:	90                   	nop

801029f0 <cmostime>:
  r->year   = cmos_read(YEAR);
}

// qemu seems to use 24-hour GWT and the values are BCD encoded
void cmostime(struct rtcdate *r)
{
801029f0:	55                   	push   %ebp
801029f1:	b8 0b 00 00 00       	mov    $0xb,%eax
801029f6:	ba 70 00 00 00       	mov    $0x70,%edx
801029fb:	89 e5                	mov    %esp,%ebp
801029fd:	57                   	push   %edi
801029fe:	56                   	push   %esi
801029ff:	53                   	push   %ebx
80102a00:	83 ec 4c             	sub    $0x4c,%esp
80102a03:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a04:	ba 71 00 00 00       	mov    $0x71,%edx
80102a09:	ec                   	in     (%dx),%al
  struct rtcdate t1, t2;
  int sb, bcd;

  sb = cmos_read(CMOS_STATB);

  bcd = (sb & (1 << 2)) == 0;
80102a0a:	83 e0 04             	and    $0x4,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a0d:	bb 70 00 00 00       	mov    $0x70,%ebx
80102a12:	88 45 b3             	mov    %al,-0x4d(%ebp)
80102a15:	8d 76 00             	lea    0x0(%esi),%esi
80102a18:	31 c0                	xor    %eax,%eax
80102a1a:	89 da                	mov    %ebx,%edx
80102a1c:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a1d:	b9 71 00 00 00       	mov    $0x71,%ecx
80102a22:	89 ca                	mov    %ecx,%edx
80102a24:	ec                   	in     (%dx),%al
80102a25:	88 45 b7             	mov    %al,-0x49(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a28:	89 da                	mov    %ebx,%edx
80102a2a:	b8 02 00 00 00       	mov    $0x2,%eax
80102a2f:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a30:	89 ca                	mov    %ecx,%edx
80102a32:	ec                   	in     (%dx),%al
80102a33:	88 45 b6             	mov    %al,-0x4a(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a36:	89 da                	mov    %ebx,%edx
80102a38:	b8 04 00 00 00       	mov    $0x4,%eax
80102a3d:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a3e:	89 ca                	mov    %ecx,%edx
80102a40:	ec                   	in     (%dx),%al
80102a41:	88 45 b5             	mov    %al,-0x4b(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a44:	89 da                	mov    %ebx,%edx
80102a46:	b8 07 00 00 00       	mov    $0x7,%eax
80102a4b:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a4c:	89 ca                	mov    %ecx,%edx
80102a4e:	ec                   	in     (%dx),%al
80102a4f:	88 45 b4             	mov    %al,-0x4c(%ebp)
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a52:	89 da                	mov    %ebx,%edx
80102a54:	b8 08 00 00 00       	mov    $0x8,%eax
80102a59:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a5a:	89 ca                	mov    %ecx,%edx
80102a5c:	ec                   	in     (%dx),%al
80102a5d:	89 c7                	mov    %eax,%edi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a5f:	89 da                	mov    %ebx,%edx
80102a61:	b8 09 00 00 00       	mov    $0x9,%eax
80102a66:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a67:	89 ca                	mov    %ecx,%edx
80102a69:	ec                   	in     (%dx),%al
80102a6a:	89 c6                	mov    %eax,%esi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a6c:	89 da                	mov    %ebx,%edx
80102a6e:	b8 0a 00 00 00       	mov    $0xa,%eax
80102a73:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102a74:	89 ca                	mov    %ecx,%edx
80102a76:	ec                   	in     (%dx),%al

  // make sure CMOS doesn't modify time while we read it
  for(;;) {
    fill_rtcdate(&t1);
    if(cmos_read(CMOS_STATA) & CMOS_UIP)
80102a77:	84 c0                	test   %al,%al
80102a79:	78 9d                	js     80102a18 <cmostime+0x28>
  return inb(CMOS_RETURN);
80102a7b:	0f b6 45 b7          	movzbl -0x49(%ebp),%eax
80102a7f:	89 fa                	mov    %edi,%edx
80102a81:	0f b6 fa             	movzbl %dl,%edi
80102a84:	89 f2                	mov    %esi,%edx
80102a86:	89 45 b8             	mov    %eax,-0x48(%ebp)
80102a89:	0f b6 45 b6          	movzbl -0x4a(%ebp),%eax
80102a8d:	0f b6 f2             	movzbl %dl,%esi
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102a90:	89 da                	mov    %ebx,%edx
80102a92:	89 7d c8             	mov    %edi,-0x38(%ebp)
80102a95:	89 45 bc             	mov    %eax,-0x44(%ebp)
80102a98:	0f b6 45 b5          	movzbl -0x4b(%ebp),%eax
80102a9c:	89 75 cc             	mov    %esi,-0x34(%ebp)
80102a9f:	89 45 c0             	mov    %eax,-0x40(%ebp)
80102aa2:	0f b6 45 b4          	movzbl -0x4c(%ebp),%eax
80102aa6:	89 45 c4             	mov    %eax,-0x3c(%ebp)
80102aa9:	31 c0                	xor    %eax,%eax
80102aab:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102aac:	89 ca                	mov    %ecx,%edx
80102aae:	ec                   	in     (%dx),%al
80102aaf:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ab2:	89 da                	mov    %ebx,%edx
80102ab4:	89 45 d0             	mov    %eax,-0x30(%ebp)
80102ab7:	b8 02 00 00 00       	mov    $0x2,%eax
80102abc:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102abd:	89 ca                	mov    %ecx,%edx
80102abf:	ec                   	in     (%dx),%al
80102ac0:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ac3:	89 da                	mov    %ebx,%edx
80102ac5:	89 45 d4             	mov    %eax,-0x2c(%ebp)
80102ac8:	b8 04 00 00 00       	mov    $0x4,%eax
80102acd:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102ace:	89 ca                	mov    %ecx,%edx
80102ad0:	ec                   	in     (%dx),%al
80102ad1:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ad4:	89 da                	mov    %ebx,%edx
80102ad6:	89 45 d8             	mov    %eax,-0x28(%ebp)
80102ad9:	b8 07 00 00 00       	mov    $0x7,%eax
80102ade:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102adf:	89 ca                	mov    %ecx,%edx
80102ae1:	ec                   	in     (%dx),%al
80102ae2:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102ae5:	89 da                	mov    %ebx,%edx
80102ae7:	89 45 dc             	mov    %eax,-0x24(%ebp)
80102aea:	b8 08 00 00 00       	mov    $0x8,%eax
80102aef:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102af0:	89 ca                	mov    %ecx,%edx
80102af2:	ec                   	in     (%dx),%al
80102af3:	0f b6 c0             	movzbl %al,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80102af6:	89 da                	mov    %ebx,%edx
80102af8:	89 45 e0             	mov    %eax,-0x20(%ebp)
80102afb:	b8 09 00 00 00       	mov    $0x9,%eax
80102b00:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80102b01:	89 ca                	mov    %ecx,%edx
80102b03:	ec                   	in     (%dx),%al
80102b04:	0f b6 c0             	movzbl %al,%eax
        continue;
    fill_rtcdate(&t2);
    if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102b07:	83 ec 04             	sub    $0x4,%esp
  return inb(CMOS_RETURN);
80102b0a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(memcmp(&t1, &t2, sizeof(t1)) == 0)
80102b0d:	8d 45 d0             	lea    -0x30(%ebp),%eax
80102b10:	6a 18                	push   $0x18
80102b12:	50                   	push   %eax
80102b13:	8d 45 b8             	lea    -0x48(%ebp),%eax
80102b16:	50                   	push   %eax
80102b17:	e8 44 21 00 00       	call   80104c60 <memcmp>
80102b1c:	83 c4 10             	add    $0x10,%esp
80102b1f:	85 c0                	test   %eax,%eax
80102b21:	0f 85 f1 fe ff ff    	jne    80102a18 <cmostime+0x28>
      break;
  }

  // convert
  if(bcd) {
80102b27:	80 7d b3 00          	cmpb   $0x0,-0x4d(%ebp)
80102b2b:	75 78                	jne    80102ba5 <cmostime+0x1b5>
#define    CONV(x)     (t1.x = ((t1.x >> 4) * 10) + (t1.x & 0xf))
    CONV(second);
80102b2d:	8b 45 b8             	mov    -0x48(%ebp),%eax
80102b30:	89 c2                	mov    %eax,%edx
80102b32:	83 e0 0f             	and    $0xf,%eax
80102b35:	c1 ea 04             	shr    $0x4,%edx
80102b38:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b3b:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102b3e:	89 45 b8             	mov    %eax,-0x48(%ebp)
    CONV(minute);
80102b41:	8b 45 bc             	mov    -0x44(%ebp),%eax
80102b44:	89 c2                	mov    %eax,%edx
80102b46:	83 e0 0f             	and    $0xf,%eax
80102b49:	c1 ea 04             	shr    $0x4,%edx
80102b4c:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b4f:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102b52:	89 45 bc             	mov    %eax,-0x44(%ebp)
    CONV(hour  );
80102b55:	8b 45 c0             	mov    -0x40(%ebp),%eax
80102b58:	89 c2                	mov    %eax,%edx
80102b5a:	83 e0 0f             	and    $0xf,%eax
80102b5d:	c1 ea 04             	shr    $0x4,%edx
80102b60:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b63:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102b66:	89 45 c0             	mov    %eax,-0x40(%ebp)
    CONV(day   );
80102b69:	8b 45 c4             	mov    -0x3c(%ebp),%eax
80102b6c:	89 c2                	mov    %eax,%edx
80102b6e:	83 e0 0f             	and    $0xf,%eax
80102b71:	c1 ea 04             	shr    $0x4,%edx
80102b74:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b77:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102b7a:	89 45 c4             	mov    %eax,-0x3c(%ebp)
    CONV(month );
80102b7d:	8b 45 c8             	mov    -0x38(%ebp),%eax
80102b80:	89 c2                	mov    %eax,%edx
80102b82:	83 e0 0f             	and    $0xf,%eax
80102b85:	c1 ea 04             	shr    $0x4,%edx
80102b88:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b8b:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102b8e:	89 45 c8             	mov    %eax,-0x38(%ebp)
    CONV(year  );
80102b91:	8b 45 cc             	mov    -0x34(%ebp),%eax
80102b94:	89 c2                	mov    %eax,%edx
80102b96:	83 e0 0f             	and    $0xf,%eax
80102b99:	c1 ea 04             	shr    $0x4,%edx
80102b9c:	8d 14 92             	lea    (%edx,%edx,4),%edx
80102b9f:	8d 04 50             	lea    (%eax,%edx,2),%eax
80102ba2:	89 45 cc             	mov    %eax,-0x34(%ebp)
#undef     CONV
  }

  *r = t1;
80102ba5:	8b 75 08             	mov    0x8(%ebp),%esi
80102ba8:	8b 45 b8             	mov    -0x48(%ebp),%eax
80102bab:	89 06                	mov    %eax,(%esi)
80102bad:	8b 45 bc             	mov    -0x44(%ebp),%eax
80102bb0:	89 46 04             	mov    %eax,0x4(%esi)
80102bb3:	8b 45 c0             	mov    -0x40(%ebp),%eax
80102bb6:	89 46 08             	mov    %eax,0x8(%esi)
80102bb9:	8b 45 c4             	mov    -0x3c(%ebp),%eax
80102bbc:	89 46 0c             	mov    %eax,0xc(%esi)
80102bbf:	8b 45 c8             	mov    -0x38(%ebp),%eax
80102bc2:	89 46 10             	mov    %eax,0x10(%esi)
80102bc5:	8b 45 cc             	mov    -0x34(%ebp),%eax
80102bc8:	89 46 14             	mov    %eax,0x14(%esi)
  r->year += 2000;
80102bcb:	81 46 14 d0 07 00 00 	addl   $0x7d0,0x14(%esi)
}
80102bd2:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102bd5:	5b                   	pop    %ebx
80102bd6:	5e                   	pop    %esi
80102bd7:	5f                   	pop    %edi
80102bd8:	5d                   	pop    %ebp
80102bd9:	c3                   	ret    
80102bda:	66 90                	xchg   %ax,%ax
80102bdc:	66 90                	xchg   %ax,%ax
80102bde:	66 90                	xchg   %ax,%ax

80102be0 <install_trans>:
static void
install_trans(void)
{
  int tail;

  for (tail = 0; tail < log.lh.n; tail++) {
80102be0:	8b 0d e8 26 11 80    	mov    0x801126e8,%ecx
80102be6:	85 c9                	test   %ecx,%ecx
80102be8:	0f 8e 8a 00 00 00    	jle    80102c78 <install_trans+0x98>
{
80102bee:	55                   	push   %ebp
80102bef:	89 e5                	mov    %esp,%ebp
80102bf1:	57                   	push   %edi
  for (tail = 0; tail < log.lh.n; tail++) {
80102bf2:	31 ff                	xor    %edi,%edi
{
80102bf4:	56                   	push   %esi
80102bf5:	53                   	push   %ebx
80102bf6:	83 ec 0c             	sub    $0xc,%esp
80102bf9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block
80102c00:	a1 d4 26 11 80       	mov    0x801126d4,%eax
80102c05:	83 ec 08             	sub    $0x8,%esp
80102c08:	01 f8                	add    %edi,%eax
80102c0a:	83 c0 01             	add    $0x1,%eax
80102c0d:	50                   	push   %eax
80102c0e:	ff 35 e4 26 11 80    	push   0x801126e4
80102c14:	e8 b7 d4 ff ff       	call   801000d0 <bread>
80102c19:	89 c6                	mov    %eax,%esi
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102c1b:	58                   	pop    %eax
80102c1c:	5a                   	pop    %edx
80102c1d:	ff 34 bd ec 26 11 80 	push   -0x7feed914(,%edi,4)
80102c24:	ff 35 e4 26 11 80    	push   0x801126e4
  for (tail = 0; tail < log.lh.n; tail++) {
80102c2a:	83 c7 01             	add    $0x1,%edi
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102c2d:	e8 9e d4 ff ff       	call   801000d0 <bread>
    memmove(dbuf->data, lbuf->data, BSIZE);  // copy block to dst
80102c32:	83 c4 0c             	add    $0xc,%esp
    struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst
80102c35:	89 c3                	mov    %eax,%ebx
    memmove(dbuf->data, lbuf->data, BSIZE);  // copy block to dst
80102c37:	8d 46 5c             	lea    0x5c(%esi),%eax
80102c3a:	68 00 02 00 00       	push   $0x200
80102c3f:	50                   	push   %eax
80102c40:	8d 43 5c             	lea    0x5c(%ebx),%eax
80102c43:	50                   	push   %eax
80102c44:	e8 67 20 00 00       	call   80104cb0 <memmove>
    bwrite(dbuf);  // write dst to disk
80102c49:	89 1c 24             	mov    %ebx,(%esp)
80102c4c:	e8 5f d5 ff ff       	call   801001b0 <bwrite>
    brelse(lbuf);
80102c51:	89 34 24             	mov    %esi,(%esp)
80102c54:	e8 97 d5 ff ff       	call   801001f0 <brelse>
    brelse(dbuf);
80102c59:	89 1c 24             	mov    %ebx,(%esp)
80102c5c:	e8 8f d5 ff ff       	call   801001f0 <brelse>
  for (tail = 0; tail < log.lh.n; tail++) {
80102c61:	83 c4 10             	add    $0x10,%esp
80102c64:	39 3d e8 26 11 80    	cmp    %edi,0x801126e8
80102c6a:	7f 94                	jg     80102c00 <install_trans+0x20>
  }
}
80102c6c:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102c6f:	5b                   	pop    %ebx
80102c70:	5e                   	pop    %esi
80102c71:	5f                   	pop    %edi
80102c72:	5d                   	pop    %ebp
80102c73:	c3                   	ret    
80102c74:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80102c78:	c3                   	ret    
80102c79:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80102c80 <write_head>:
// Write in-memory log header to disk.
// This is the true point at which the
// current transaction commits.
static void
write_head(void)
{
80102c80:	55                   	push   %ebp
80102c81:	89 e5                	mov    %esp,%ebp
80102c83:	53                   	push   %ebx
80102c84:	83 ec 0c             	sub    $0xc,%esp
  struct buf *buf = bread(log.dev, log.start);
80102c87:	ff 35 d4 26 11 80    	push   0x801126d4
80102c8d:	ff 35 e4 26 11 80    	push   0x801126e4
80102c93:	e8 38 d4 ff ff       	call   801000d0 <bread>
  struct logheader *hb = (struct logheader *) (buf->data);
  int i;
  hb->n = log.lh.n;
  for (i = 0; i < log.lh.n; i++) {
80102c98:	83 c4 10             	add    $0x10,%esp
  struct buf *buf = bread(log.dev, log.start);
80102c9b:	89 c3                	mov    %eax,%ebx
  hb->n = log.lh.n;
80102c9d:	a1 e8 26 11 80       	mov    0x801126e8,%eax
80102ca2:	89 43 5c             	mov    %eax,0x5c(%ebx)
  for (i = 0; i < log.lh.n; i++) {
80102ca5:	85 c0                	test   %eax,%eax
80102ca7:	7e 19                	jle    80102cc2 <write_head+0x42>
80102ca9:	31 d2                	xor    %edx,%edx
80102cab:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80102caf:	90                   	nop
    hb->block[i] = log.lh.block[i];
80102cb0:	8b 0c 95 ec 26 11 80 	mov    -0x7feed914(,%edx,4),%ecx
80102cb7:	89 4c 93 60          	mov    %ecx,0x60(%ebx,%edx,4)
  for (i = 0; i < log.lh.n; i++) {
80102cbb:	83 c2 01             	add    $0x1,%edx
80102cbe:	39 d0                	cmp    %edx,%eax
80102cc0:	75 ee                	jne    80102cb0 <write_head+0x30>
  }
  bwrite(buf);
80102cc2:	83 ec 0c             	sub    $0xc,%esp
80102cc5:	53                   	push   %ebx
80102cc6:	e8 e5 d4 ff ff       	call   801001b0 <bwrite>
  brelse(buf);
80102ccb:	89 1c 24             	mov    %ebx,(%esp)
80102cce:	e8 1d d5 ff ff       	call   801001f0 <brelse>
}
80102cd3:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80102cd6:	83 c4 10             	add    $0x10,%esp
80102cd9:	c9                   	leave  
80102cda:	c3                   	ret    
80102cdb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80102cdf:	90                   	nop

80102ce0 <initlog>:
{
80102ce0:	55                   	push   %ebp
80102ce1:	89 e5                	mov    %esp,%ebp
80102ce3:	53                   	push   %ebx
80102ce4:	83 ec 2c             	sub    $0x2c,%esp
80102ce7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  initlock(&log.lock, "log");
80102cea:	68 e0 7d 10 80       	push   $0x80107de0
80102cef:	68 a0 26 11 80       	push   $0x801126a0
80102cf4:	e8 97 1c 00 00       	call   80104990 <initlock>
  readsb(dev, &sb);
80102cf9:	58                   	pop    %eax
80102cfa:	8d 45 dc             	lea    -0x24(%ebp),%eax
80102cfd:	5a                   	pop    %edx
80102cfe:	50                   	push   %eax
80102cff:	53                   	push   %ebx
80102d00:	e8 3b e8 ff ff       	call   80101540 <readsb>
  log.start = sb.logstart;
80102d05:	8b 45 ec             	mov    -0x14(%ebp),%eax
  struct buf *buf = bread(log.dev, log.start);
80102d08:	59                   	pop    %ecx
  log.dev = dev;
80102d09:	89 1d e4 26 11 80    	mov    %ebx,0x801126e4
  log.size = sb.nlog;
80102d0f:	8b 55 e8             	mov    -0x18(%ebp),%edx
  log.start = sb.logstart;
80102d12:	a3 d4 26 11 80       	mov    %eax,0x801126d4
  log.size = sb.nlog;
80102d17:	89 15 d8 26 11 80    	mov    %edx,0x801126d8
  struct buf *buf = bread(log.dev, log.start);
80102d1d:	5a                   	pop    %edx
80102d1e:	50                   	push   %eax
80102d1f:	53                   	push   %ebx
80102d20:	e8 ab d3 ff ff       	call   801000d0 <bread>
  for (i = 0; i < log.lh.n; i++) {
80102d25:	83 c4 10             	add    $0x10,%esp
  log.lh.n = lh->n;
80102d28:	8b 58 5c             	mov    0x5c(%eax),%ebx
80102d2b:	89 1d e8 26 11 80    	mov    %ebx,0x801126e8
  for (i = 0; i < log.lh.n; i++) {
80102d31:	85 db                	test   %ebx,%ebx
80102d33:	7e 1d                	jle    80102d52 <initlog+0x72>
80102d35:	31 d2                	xor    %edx,%edx
80102d37:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102d3e:	66 90                	xchg   %ax,%ax
    log.lh.block[i] = lh->block[i];
80102d40:	8b 4c 90 60          	mov    0x60(%eax,%edx,4),%ecx
80102d44:	89 0c 95 ec 26 11 80 	mov    %ecx,-0x7feed914(,%edx,4)
  for (i = 0; i < log.lh.n; i++) {
80102d4b:	83 c2 01             	add    $0x1,%edx
80102d4e:	39 d3                	cmp    %edx,%ebx
80102d50:	75 ee                	jne    80102d40 <initlog+0x60>
  brelse(buf);
80102d52:	83 ec 0c             	sub    $0xc,%esp
80102d55:	50                   	push   %eax
80102d56:	e8 95 d4 ff ff       	call   801001f0 <brelse>

static void
recover_from_log(void)
{
  read_head();
  install_trans(); // if committed, copy from log to disk
80102d5b:	e8 80 fe ff ff       	call   80102be0 <install_trans>
  log.lh.n = 0;
80102d60:	c7 05 e8 26 11 80 00 	movl   $0x0,0x801126e8
80102d67:	00 00 00 
  write_head(); // clear the log
80102d6a:	e8 11 ff ff ff       	call   80102c80 <write_head>
}
80102d6f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80102d72:	83 c4 10             	add    $0x10,%esp
80102d75:	c9                   	leave  
80102d76:	c3                   	ret    
80102d77:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102d7e:	66 90                	xchg   %ax,%ax

80102d80 <begin_op>:
}

// called at the start of each FS system call.
void
begin_op(void)
{
80102d80:	55                   	push   %ebp
80102d81:	89 e5                	mov    %esp,%ebp
80102d83:	83 ec 14             	sub    $0x14,%esp
  acquire(&log.lock);
80102d86:	68 a0 26 11 80       	push   $0x801126a0
80102d8b:	e8 10 1d 00 00       	call   80104aa0 <acquire>
80102d90:	83 c4 10             	add    $0x10,%esp
80102d93:	eb 18                	jmp    80102dad <begin_op+0x2d>
80102d95:	8d 76 00             	lea    0x0(%esi),%esi
  while(1){
    if(log.committing){
      sleep(&log, &log.lock);
80102d98:	83 ec 08             	sub    $0x8,%esp
80102d9b:	68 a0 26 11 80       	push   $0x801126a0
80102da0:	68 a0 26 11 80       	push   $0x801126a0
80102da5:	e8 56 14 00 00       	call   80104200 <sleep>
80102daa:	83 c4 10             	add    $0x10,%esp
    if(log.committing){
80102dad:	a1 e0 26 11 80       	mov    0x801126e0,%eax
80102db2:	85 c0                	test   %eax,%eax
80102db4:	75 e2                	jne    80102d98 <begin_op+0x18>
    } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){
80102db6:	a1 dc 26 11 80       	mov    0x801126dc,%eax
80102dbb:	8b 15 e8 26 11 80    	mov    0x801126e8,%edx
80102dc1:	83 c0 01             	add    $0x1,%eax
80102dc4:	8d 0c 80             	lea    (%eax,%eax,4),%ecx
80102dc7:	8d 14 4a             	lea    (%edx,%ecx,2),%edx
80102dca:	83 fa 1e             	cmp    $0x1e,%edx
80102dcd:	7f c9                	jg     80102d98 <begin_op+0x18>
      // this op might exhaust log space; wait for commit.
      sleep(&log, &log.lock);
    } else {
      log.outstanding += 1;
      release(&log.lock);
80102dcf:	83 ec 0c             	sub    $0xc,%esp
      log.outstanding += 1;
80102dd2:	a3 dc 26 11 80       	mov    %eax,0x801126dc
      release(&log.lock);
80102dd7:	68 a0 26 11 80       	push   $0x801126a0
80102ddc:	e8 df 1d 00 00       	call   80104bc0 <release>
      break;
    }
  }
}
80102de1:	83 c4 10             	add    $0x10,%esp
80102de4:	c9                   	leave  
80102de5:	c3                   	ret    
80102de6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102ded:	8d 76 00             	lea    0x0(%esi),%esi

80102df0 <end_op>:

// called at the end of each FS system call.
// commits if this was the last outstanding operation.
void
end_op(void)
{
80102df0:	55                   	push   %ebp
80102df1:	89 e5                	mov    %esp,%ebp
80102df3:	57                   	push   %edi
80102df4:	56                   	push   %esi
80102df5:	53                   	push   %ebx
80102df6:	83 ec 18             	sub    $0x18,%esp
  int do_commit = 0;

  acquire(&log.lock);
80102df9:	68 a0 26 11 80       	push   $0x801126a0
80102dfe:	e8 9d 1c 00 00       	call   80104aa0 <acquire>
  log.outstanding -= 1;
80102e03:	a1 dc 26 11 80       	mov    0x801126dc,%eax
  if(log.committing)
80102e08:	8b 35 e0 26 11 80    	mov    0x801126e0,%esi
80102e0e:	83 c4 10             	add    $0x10,%esp
  log.outstanding -= 1;
80102e11:	8d 58 ff             	lea    -0x1(%eax),%ebx
80102e14:	89 1d dc 26 11 80    	mov    %ebx,0x801126dc
  if(log.committing)
80102e1a:	85 f6                	test   %esi,%esi
80102e1c:	0f 85 22 01 00 00    	jne    80102f44 <end_op+0x154>
    panic("log.committing");
  if(log.outstanding == 0){
80102e22:	85 db                	test   %ebx,%ebx
80102e24:	0f 85 f6 00 00 00    	jne    80102f20 <end_op+0x130>
    do_commit = 1;
    log.committing = 1;
80102e2a:	c7 05 e0 26 11 80 01 	movl   $0x1,0x801126e0
80102e31:	00 00 00 
    // begin_op() may be waiting for log space,
    // and decrementing log.outstanding has decreased
    // the amount of reserved space.
    wakeup(&log);
  }
  release(&log.lock);
80102e34:	83 ec 0c             	sub    $0xc,%esp
80102e37:	68 a0 26 11 80       	push   $0x801126a0
80102e3c:	e8 7f 1d 00 00       	call   80104bc0 <release>
}

static void
commit()
{
  if (log.lh.n > 0) {
80102e41:	8b 0d e8 26 11 80    	mov    0x801126e8,%ecx
80102e47:	83 c4 10             	add    $0x10,%esp
80102e4a:	85 c9                	test   %ecx,%ecx
80102e4c:	7f 42                	jg     80102e90 <end_op+0xa0>
    acquire(&log.lock);
80102e4e:	83 ec 0c             	sub    $0xc,%esp
80102e51:	68 a0 26 11 80       	push   $0x801126a0
80102e56:	e8 45 1c 00 00       	call   80104aa0 <acquire>
    wakeup(&log);
80102e5b:	c7 04 24 a0 26 11 80 	movl   $0x801126a0,(%esp)
    log.committing = 0;
80102e62:	c7 05 e0 26 11 80 00 	movl   $0x0,0x801126e0
80102e69:	00 00 00 
    wakeup(&log);
80102e6c:	e8 4f 14 00 00       	call   801042c0 <wakeup>
    release(&log.lock);
80102e71:	c7 04 24 a0 26 11 80 	movl   $0x801126a0,(%esp)
80102e78:	e8 43 1d 00 00       	call   80104bc0 <release>
80102e7d:	83 c4 10             	add    $0x10,%esp
}
80102e80:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102e83:	5b                   	pop    %ebx
80102e84:	5e                   	pop    %esi
80102e85:	5f                   	pop    %edi
80102e86:	5d                   	pop    %ebp
80102e87:	c3                   	ret    
80102e88:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102e8f:	90                   	nop
    struct buf *to = bread(log.dev, log.start+tail+1); // log block
80102e90:	a1 d4 26 11 80       	mov    0x801126d4,%eax
80102e95:	83 ec 08             	sub    $0x8,%esp
80102e98:	01 d8                	add    %ebx,%eax
80102e9a:	83 c0 01             	add    $0x1,%eax
80102e9d:	50                   	push   %eax
80102e9e:	ff 35 e4 26 11 80    	push   0x801126e4
80102ea4:	e8 27 d2 ff ff       	call   801000d0 <bread>
80102ea9:	89 c6                	mov    %eax,%esi
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102eab:	58                   	pop    %eax
80102eac:	5a                   	pop    %edx
80102ead:	ff 34 9d ec 26 11 80 	push   -0x7feed914(,%ebx,4)
80102eb4:	ff 35 e4 26 11 80    	push   0x801126e4
  for (tail = 0; tail < log.lh.n; tail++) {
80102eba:	83 c3 01             	add    $0x1,%ebx
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102ebd:	e8 0e d2 ff ff       	call   801000d0 <bread>
    memmove(to->data, from->data, BSIZE);
80102ec2:	83 c4 0c             	add    $0xc,%esp
    struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block
80102ec5:	89 c7                	mov    %eax,%edi
    memmove(to->data, from->data, BSIZE);
80102ec7:	8d 40 5c             	lea    0x5c(%eax),%eax
80102eca:	68 00 02 00 00       	push   $0x200
80102ecf:	50                   	push   %eax
80102ed0:	8d 46 5c             	lea    0x5c(%esi),%eax
80102ed3:	50                   	push   %eax
80102ed4:	e8 d7 1d 00 00       	call   80104cb0 <memmove>
    bwrite(to);  // write the log
80102ed9:	89 34 24             	mov    %esi,(%esp)
80102edc:	e8 cf d2 ff ff       	call   801001b0 <bwrite>
    brelse(from);
80102ee1:	89 3c 24             	mov    %edi,(%esp)
80102ee4:	e8 07 d3 ff ff       	call   801001f0 <brelse>
    brelse(to);
80102ee9:	89 34 24             	mov    %esi,(%esp)
80102eec:	e8 ff d2 ff ff       	call   801001f0 <brelse>
  for (tail = 0; tail < log.lh.n; tail++) {
80102ef1:	83 c4 10             	add    $0x10,%esp
80102ef4:	3b 1d e8 26 11 80    	cmp    0x801126e8,%ebx
80102efa:	7c 94                	jl     80102e90 <end_op+0xa0>
    write_log();     // Write modified blocks from cache to log
    write_head();    // Write header to disk -- the real commit
80102efc:	e8 7f fd ff ff       	call   80102c80 <write_head>
    install_trans(); // Now install writes to home locations
80102f01:	e8 da fc ff ff       	call   80102be0 <install_trans>
    log.lh.n = 0;
80102f06:	c7 05 e8 26 11 80 00 	movl   $0x0,0x801126e8
80102f0d:	00 00 00 
    write_head();    // Erase the transaction from the log
80102f10:	e8 6b fd ff ff       	call   80102c80 <write_head>
80102f15:	e9 34 ff ff ff       	jmp    80102e4e <end_op+0x5e>
80102f1a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    wakeup(&log);
80102f20:	83 ec 0c             	sub    $0xc,%esp
80102f23:	68 a0 26 11 80       	push   $0x801126a0
80102f28:	e8 93 13 00 00       	call   801042c0 <wakeup>
  release(&log.lock);
80102f2d:	c7 04 24 a0 26 11 80 	movl   $0x801126a0,(%esp)
80102f34:	e8 87 1c 00 00       	call   80104bc0 <release>
80102f39:	83 c4 10             	add    $0x10,%esp
}
80102f3c:	8d 65 f4             	lea    -0xc(%ebp),%esp
80102f3f:	5b                   	pop    %ebx
80102f40:	5e                   	pop    %esi
80102f41:	5f                   	pop    %edi
80102f42:	5d                   	pop    %ebp
80102f43:	c3                   	ret    
    panic("log.committing");
80102f44:	83 ec 0c             	sub    $0xc,%esp
80102f47:	68 e4 7d 10 80       	push   $0x80107de4
80102f4c:	e8 2f d4 ff ff       	call   80100380 <panic>
80102f51:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102f58:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80102f5f:	90                   	nop

80102f60 <log_write>:
//   modify bp->data[]
//   log_write(bp)
//   brelse(bp)
void
log_write(struct buf *b)
{
80102f60:	55                   	push   %ebp
80102f61:	89 e5                	mov    %esp,%ebp
80102f63:	53                   	push   %ebx
80102f64:	83 ec 04             	sub    $0x4,%esp
  int i;

  if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102f67:	8b 15 e8 26 11 80    	mov    0x801126e8,%edx
{
80102f6d:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1)
80102f70:	83 fa 1d             	cmp    $0x1d,%edx
80102f73:	0f 8f 85 00 00 00    	jg     80102ffe <log_write+0x9e>
80102f79:	a1 d8 26 11 80       	mov    0x801126d8,%eax
80102f7e:	83 e8 01             	sub    $0x1,%eax
80102f81:	39 c2                	cmp    %eax,%edx
80102f83:	7d 79                	jge    80102ffe <log_write+0x9e>
    panic("too big a transaction");
  if (log.outstanding < 1)
80102f85:	a1 dc 26 11 80       	mov    0x801126dc,%eax
80102f8a:	85 c0                	test   %eax,%eax
80102f8c:	7e 7d                	jle    8010300b <log_write+0xab>
    panic("log_write outside of trans");

  acquire(&log.lock);
80102f8e:	83 ec 0c             	sub    $0xc,%esp
80102f91:	68 a0 26 11 80       	push   $0x801126a0
80102f96:	e8 05 1b 00 00       	call   80104aa0 <acquire>
  for (i = 0; i < log.lh.n; i++) {
80102f9b:	8b 15 e8 26 11 80    	mov    0x801126e8,%edx
80102fa1:	83 c4 10             	add    $0x10,%esp
80102fa4:	85 d2                	test   %edx,%edx
80102fa6:	7e 4a                	jle    80102ff2 <log_write+0x92>
    if (log.lh.block[i] == b->blockno)   // log absorbtion
80102fa8:	8b 4b 08             	mov    0x8(%ebx),%ecx
  for (i = 0; i < log.lh.n; i++) {
80102fab:	31 c0                	xor    %eax,%eax
80102fad:	eb 08                	jmp    80102fb7 <log_write+0x57>
80102faf:	90                   	nop
80102fb0:	83 c0 01             	add    $0x1,%eax
80102fb3:	39 c2                	cmp    %eax,%edx
80102fb5:	74 29                	je     80102fe0 <log_write+0x80>
    if (log.lh.block[i] == b->blockno)   // log absorbtion
80102fb7:	39 0c 85 ec 26 11 80 	cmp    %ecx,-0x7feed914(,%eax,4)
80102fbe:	75 f0                	jne    80102fb0 <log_write+0x50>
      break;
  }
  log.lh.block[i] = b->blockno;
80102fc0:	89 0c 85 ec 26 11 80 	mov    %ecx,-0x7feed914(,%eax,4)
  if (i == log.lh.n)
    log.lh.n++;
  b->flags |= B_DIRTY; // prevent eviction
80102fc7:	83 0b 04             	orl    $0x4,(%ebx)
  release(&log.lock);
}
80102fca:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  release(&log.lock);
80102fcd:	c7 45 08 a0 26 11 80 	movl   $0x801126a0,0x8(%ebp)
}
80102fd4:	c9                   	leave  
  release(&log.lock);
80102fd5:	e9 e6 1b 00 00       	jmp    80104bc0 <release>
80102fda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  log.lh.block[i] = b->blockno;
80102fe0:	89 0c 95 ec 26 11 80 	mov    %ecx,-0x7feed914(,%edx,4)
    log.lh.n++;
80102fe7:	83 c2 01             	add    $0x1,%edx
80102fea:	89 15 e8 26 11 80    	mov    %edx,0x801126e8
80102ff0:	eb d5                	jmp    80102fc7 <log_write+0x67>
  log.lh.block[i] = b->blockno;
80102ff2:	8b 43 08             	mov    0x8(%ebx),%eax
80102ff5:	a3 ec 26 11 80       	mov    %eax,0x801126ec
  if (i == log.lh.n)
80102ffa:	75 cb                	jne    80102fc7 <log_write+0x67>
80102ffc:	eb e9                	jmp    80102fe7 <log_write+0x87>
    panic("too big a transaction");
80102ffe:	83 ec 0c             	sub    $0xc,%esp
80103001:	68 f3 7d 10 80       	push   $0x80107df3
80103006:	e8 75 d3 ff ff       	call   80100380 <panic>
    panic("log_write outside of trans");
8010300b:	83 ec 0c             	sub    $0xc,%esp
8010300e:	68 09 7e 10 80       	push   $0x80107e09
80103013:	e8 68 d3 ff ff       	call   80100380 <panic>
80103018:	66 90                	xchg   %ax,%ax
8010301a:	66 90                	xchg   %ax,%ax
8010301c:	66 90                	xchg   %ax,%ax
8010301e:	66 90                	xchg   %ax,%ax

80103020 <mpmain>:
}

// Common CPU setup code.
static void
mpmain(void)
{
80103020:	55                   	push   %ebp
80103021:	89 e5                	mov    %esp,%ebp
80103023:	53                   	push   %ebx
80103024:	83 ec 04             	sub    $0x4,%esp
  cprintf("cpu%d: starting %d\n", cpuid(), cpuid());
80103027:	e8 54 09 00 00       	call   80103980 <cpuid>
8010302c:	89 c3                	mov    %eax,%ebx
8010302e:	e8 4d 09 00 00       	call   80103980 <cpuid>
80103033:	83 ec 04             	sub    $0x4,%esp
80103036:	53                   	push   %ebx
80103037:	50                   	push   %eax
80103038:	68 24 7e 10 80       	push   $0x80107e24
8010303d:	e8 5e d6 ff ff       	call   801006a0 <cprintf>
  idtinit();       // load idt register
80103042:	e8 19 30 00 00       	call   80106060 <idtinit>
  xchg(&(mycpu()->started), 1); // tell startothers() we're up
80103047:	e8 d4 08 00 00       	call   80103920 <mycpu>
8010304c:	89 c2                	mov    %eax,%edx
xchg(volatile uint *addr, uint newval)
{
  uint result;

  // The + in "+m" denotes a read-modify-write operand.
  asm volatile("lock; xchgl %0, %1" :
8010304e:	b8 01 00 00 00       	mov    $0x1,%eax
80103053:	f0 87 82 a0 00 00 00 	lock xchg %eax,0xa0(%edx)
  scheduler();     // start running processes
8010305a:	e8 91 0c 00 00       	call   80103cf0 <scheduler>
8010305f:	90                   	nop

80103060 <mpenter>:
{
80103060:	55                   	push   %ebp
80103061:	89 e5                	mov    %esp,%ebp
80103063:	83 ec 08             	sub    $0x8,%esp
  switchkvm();
80103066:	e8 25 41 00 00       	call   80107190 <switchkvm>
  seginit();
8010306b:	e8 90 40 00 00       	call   80107100 <seginit>
  lapicinit();
80103070:	e8 9b f7 ff ff       	call   80102810 <lapicinit>
  mpmain();
80103075:	e8 a6 ff ff ff       	call   80103020 <mpmain>
8010307a:	66 90                	xchg   %ax,%ax
8010307c:	66 90                	xchg   %ax,%ax
8010307e:	66 90                	xchg   %ax,%ax

80103080 <main>:
{
80103080:	8d 4c 24 04          	lea    0x4(%esp),%ecx
80103084:	83 e4 f0             	and    $0xfffffff0,%esp
80103087:	ff 71 fc             	push   -0x4(%ecx)
8010308a:	55                   	push   %ebp
8010308b:	89 e5                	mov    %esp,%ebp
8010308d:	53                   	push   %ebx
8010308e:	51                   	push   %ecx
  kinit1(end, P2V(4*1024*1024)); // phys page allocator
8010308f:	83 ec 08             	sub    $0x8,%esp
80103092:	68 00 00 40 80       	push   $0x80400000
80103097:	68 d0 e6 11 80       	push   $0x8011e6d0
8010309c:	e8 8f f5 ff ff       	call   80102630 <kinit1>
  kvmalloc();      // kernel page table
801030a1:	e8 da 45 00 00       	call   80107680 <kvmalloc>
  mpinit();        // detect other processors
801030a6:	e8 85 01 00 00       	call   80103230 <mpinit>
  lapicinit();     // interrupt controller
801030ab:	e8 60 f7 ff ff       	call   80102810 <lapicinit>
  seginit();       // segment descriptors
801030b0:	e8 4b 40 00 00       	call   80107100 <seginit>
  picinit();       // disable pic
801030b5:	e8 76 03 00 00       	call   80103430 <picinit>
  ioapicinit();    // another interrupt controller
801030ba:	e8 31 f3 ff ff       	call   801023f0 <ioapicinit>
  consoleinit();   // console hardware
801030bf:	e8 9c d9 ff ff       	call   80100a60 <consoleinit>
  uartinit();      // serial port
801030c4:	e8 c7 32 00 00       	call   80106390 <uartinit>
  pinit();         // process table
801030c9:	e8 32 08 00 00       	call   80103900 <pinit>
  tvinit();        // trap vectors
801030ce:	e8 0d 2f 00 00       	call   80105fe0 <tvinit>
  binit();         // buffer cache
801030d3:	e8 68 cf ff ff       	call   80100040 <binit>
  fileinit();      // file table
801030d8:	e8 33 dd ff ff       	call   80100e10 <fileinit>
  ideinit();       // disk 
801030dd:	e8 fe f0 ff ff       	call   801021e0 <ideinit>

  // Write entry code to unused memory at 0x7000.
  // The linker has placed the image of entryother.S in
  // _binary_entryother_start.
  code = P2V(0x7000);
  memmove(code, _binary_entryother_start, (uint)_binary_entryother_size);
801030e2:	83 c4 0c             	add    $0xc,%esp
801030e5:	68 8a 00 00 00       	push   $0x8a
801030ea:	68 8c b4 10 80       	push   $0x8010b48c
801030ef:	68 00 70 00 80       	push   $0x80007000
801030f4:	e8 b7 1b 00 00       	call   80104cb0 <memmove>

  for(c = cpus; c < cpus+ncpu; c++){
801030f9:	83 c4 10             	add    $0x10,%esp
801030fc:	69 05 84 27 11 80 b0 	imul   $0xb0,0x80112784,%eax
80103103:	00 00 00 
80103106:	05 a0 27 11 80       	add    $0x801127a0,%eax
8010310b:	3d a0 27 11 80       	cmp    $0x801127a0,%eax
80103110:	76 7e                	jbe    80103190 <main+0x110>
80103112:	bb a0 27 11 80       	mov    $0x801127a0,%ebx
80103117:	eb 20                	jmp    80103139 <main+0xb9>
80103119:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103120:	69 05 84 27 11 80 b0 	imul   $0xb0,0x80112784,%eax
80103127:	00 00 00 
8010312a:	81 c3 b0 00 00 00    	add    $0xb0,%ebx
80103130:	05 a0 27 11 80       	add    $0x801127a0,%eax
80103135:	39 c3                	cmp    %eax,%ebx
80103137:	73 57                	jae    80103190 <main+0x110>
    if(c == mycpu())  // We've started already.
80103139:	e8 e2 07 00 00       	call   80103920 <mycpu>
8010313e:	39 c3                	cmp    %eax,%ebx
80103140:	74 de                	je     80103120 <main+0xa0>
      continue;

    // Tell entryother.S what stack to use, where to enter, and what
    // pgdir to use. We cannot use kpgdir yet, because the AP processor
    // is running in low  memory, so we use entrypgdir for the APs too.
    stack = kalloc();
80103142:	e8 59 f5 ff ff       	call   801026a0 <kalloc>
    *(void**)(code-4) = stack + KSTACKSIZE;
    *(void**)(code-8) = mpenter;
    *(int**)(code-12) = (void *) V2P(entrypgdir);

    lapicstartap(c->apicid, V2P(code));
80103147:	83 ec 08             	sub    $0x8,%esp
    *(void**)(code-8) = mpenter;
8010314a:	c7 05 f8 6f 00 80 60 	movl   $0x80103060,0x80006ff8
80103151:	30 10 80 
    *(int**)(code-12) = (void *) V2P(entrypgdir);
80103154:	c7 05 f4 6f 00 80 00 	movl   $0x10a000,0x80006ff4
8010315b:	a0 10 00 
    *(void**)(code-4) = stack + KSTACKSIZE;
8010315e:	05 00 10 00 00       	add    $0x1000,%eax
80103163:	a3 fc 6f 00 80       	mov    %eax,0x80006ffc
    lapicstartap(c->apicid, V2P(code));
80103168:	0f b6 03             	movzbl (%ebx),%eax
8010316b:	68 00 70 00 00       	push   $0x7000
80103170:	50                   	push   %eax
80103171:	e8 ea f7 ff ff       	call   80102960 <lapicstartap>

    // wait for cpu to finish mpmain()
    while(c->started == 0)
80103176:	83 c4 10             	add    $0x10,%esp
80103179:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103180:	8b 83 a0 00 00 00    	mov    0xa0(%ebx),%eax
80103186:	85 c0                	test   %eax,%eax
80103188:	74 f6                	je     80103180 <main+0x100>
8010318a:	eb 94                	jmp    80103120 <main+0xa0>
8010318c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  kinit2(P2V(4*1024*1024), P2V(PHYSTOP)); // must come after startothers()
80103190:	83 ec 08             	sub    $0x8,%esp
80103193:	68 00 00 00 8e       	push   $0x8e000000
80103198:	68 00 00 40 80       	push   $0x80400000
8010319d:	e8 2e f4 ff ff       	call   801025d0 <kinit2>
  userinit();      // first user process
801031a2:	e8 29 08 00 00       	call   801039d0 <userinit>
  mpmain();        // finish this processor's setup
801031a7:	e8 74 fe ff ff       	call   80103020 <mpmain>
801031ac:	66 90                	xchg   %ax,%ax
801031ae:	66 90                	xchg   %ax,%ax

801031b0 <mpsearch1>:
}

// Look for an MP structure in the len bytes at addr.
static struct mp*
mpsearch1(uint a, int len)
{
801031b0:	55                   	push   %ebp
801031b1:	89 e5                	mov    %esp,%ebp
801031b3:	57                   	push   %edi
801031b4:	56                   	push   %esi
  uchar *e, *p, *addr;

  addr = P2V(a);
801031b5:	8d b0 00 00 00 80    	lea    -0x80000000(%eax),%esi
{
801031bb:	53                   	push   %ebx
  e = addr+len;
801031bc:	8d 1c 16             	lea    (%esi,%edx,1),%ebx
{
801031bf:	83 ec 0c             	sub    $0xc,%esp
  for(p = addr; p < e; p += sizeof(struct mp))
801031c2:	39 de                	cmp    %ebx,%esi
801031c4:	72 10                	jb     801031d6 <mpsearch1+0x26>
801031c6:	eb 50                	jmp    80103218 <mpsearch1+0x68>
801031c8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801031cf:	90                   	nop
801031d0:	89 fe                	mov    %edi,%esi
801031d2:	39 fb                	cmp    %edi,%ebx
801031d4:	76 42                	jbe    80103218 <mpsearch1+0x68>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801031d6:	83 ec 04             	sub    $0x4,%esp
801031d9:	8d 7e 10             	lea    0x10(%esi),%edi
801031dc:	6a 04                	push   $0x4
801031de:	68 38 7e 10 80       	push   $0x80107e38
801031e3:	56                   	push   %esi
801031e4:	e8 77 1a 00 00       	call   80104c60 <memcmp>
801031e9:	83 c4 10             	add    $0x10,%esp
801031ec:	85 c0                	test   %eax,%eax
801031ee:	75 e0                	jne    801031d0 <mpsearch1+0x20>
801031f0:	89 f2                	mov    %esi,%edx
801031f2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    sum += addr[i];
801031f8:	0f b6 0a             	movzbl (%edx),%ecx
  for(i=0; i<len; i++)
801031fb:	83 c2 01             	add    $0x1,%edx
    sum += addr[i];
801031fe:	01 c8                	add    %ecx,%eax
  for(i=0; i<len; i++)
80103200:	39 fa                	cmp    %edi,%edx
80103202:	75 f4                	jne    801031f8 <mpsearch1+0x48>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
80103204:	84 c0                	test   %al,%al
80103206:	75 c8                	jne    801031d0 <mpsearch1+0x20>
      return (struct mp*)p;
  return 0;
}
80103208:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010320b:	89 f0                	mov    %esi,%eax
8010320d:	5b                   	pop    %ebx
8010320e:	5e                   	pop    %esi
8010320f:	5f                   	pop    %edi
80103210:	5d                   	pop    %ebp
80103211:	c3                   	ret    
80103212:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80103218:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
8010321b:	31 f6                	xor    %esi,%esi
}
8010321d:	5b                   	pop    %ebx
8010321e:	89 f0                	mov    %esi,%eax
80103220:	5e                   	pop    %esi
80103221:	5f                   	pop    %edi
80103222:	5d                   	pop    %ebp
80103223:	c3                   	ret    
80103224:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010322b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010322f:	90                   	nop

80103230 <mpinit>:
  return conf;
}

void
mpinit(void)
{
80103230:	55                   	push   %ebp
80103231:	89 e5                	mov    %esp,%ebp
80103233:	57                   	push   %edi
80103234:	56                   	push   %esi
80103235:	53                   	push   %ebx
80103236:	83 ec 1c             	sub    $0x1c,%esp
  if((p = ((bda[0x0F]<<8)| bda[0x0E]) << 4)){
80103239:	0f b6 05 0f 04 00 80 	movzbl 0x8000040f,%eax
80103240:	0f b6 15 0e 04 00 80 	movzbl 0x8000040e,%edx
80103247:	c1 e0 08             	shl    $0x8,%eax
8010324a:	09 d0                	or     %edx,%eax
8010324c:	c1 e0 04             	shl    $0x4,%eax
8010324f:	75 1b                	jne    8010326c <mpinit+0x3c>
    p = ((bda[0x14]<<8)|bda[0x13])*1024;
80103251:	0f b6 05 14 04 00 80 	movzbl 0x80000414,%eax
80103258:	0f b6 15 13 04 00 80 	movzbl 0x80000413,%edx
8010325f:	c1 e0 08             	shl    $0x8,%eax
80103262:	09 d0                	or     %edx,%eax
80103264:	c1 e0 0a             	shl    $0xa,%eax
    if((mp = mpsearch1(p-1024, 1024)))
80103267:	2d 00 04 00 00       	sub    $0x400,%eax
    if((mp = mpsearch1(p, 1024)))
8010326c:	ba 00 04 00 00       	mov    $0x400,%edx
80103271:	e8 3a ff ff ff       	call   801031b0 <mpsearch1>
80103276:	89 c3                	mov    %eax,%ebx
80103278:	85 c0                	test   %eax,%eax
8010327a:	0f 84 40 01 00 00    	je     801033c0 <mpinit+0x190>
  if((mp = mpsearch()) == 0 || mp->physaddr == 0)
80103280:	8b 73 04             	mov    0x4(%ebx),%esi
80103283:	85 f6                	test   %esi,%esi
80103285:	0f 84 25 01 00 00    	je     801033b0 <mpinit+0x180>
  if(memcmp(conf, "PCMP", 4) != 0)
8010328b:	83 ec 04             	sub    $0x4,%esp
  conf = (struct mpconf*) P2V((uint) mp->physaddr);
8010328e:	8d 86 00 00 00 80    	lea    -0x80000000(%esi),%eax
  if(memcmp(conf, "PCMP", 4) != 0)
80103294:	6a 04                	push   $0x4
80103296:	68 3d 7e 10 80       	push   $0x80107e3d
8010329b:	50                   	push   %eax
  conf = (struct mpconf*) P2V((uint) mp->physaddr);
8010329c:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(memcmp(conf, "PCMP", 4) != 0)
8010329f:	e8 bc 19 00 00       	call   80104c60 <memcmp>
801032a4:	83 c4 10             	add    $0x10,%esp
801032a7:	85 c0                	test   %eax,%eax
801032a9:	0f 85 01 01 00 00    	jne    801033b0 <mpinit+0x180>
  if(conf->version != 1 && conf->version != 4)
801032af:	0f b6 86 06 00 00 80 	movzbl -0x7ffffffa(%esi),%eax
801032b6:	3c 01                	cmp    $0x1,%al
801032b8:	74 08                	je     801032c2 <mpinit+0x92>
801032ba:	3c 04                	cmp    $0x4,%al
801032bc:	0f 85 ee 00 00 00    	jne    801033b0 <mpinit+0x180>
  if(sum((uchar*)conf, conf->length) != 0)
801032c2:	0f b7 96 04 00 00 80 	movzwl -0x7ffffffc(%esi),%edx
  for(i=0; i<len; i++)
801032c9:	66 85 d2             	test   %dx,%dx
801032cc:	74 22                	je     801032f0 <mpinit+0xc0>
801032ce:	8d 3c 32             	lea    (%edx,%esi,1),%edi
801032d1:	89 f0                	mov    %esi,%eax
  sum = 0;
801032d3:	31 d2                	xor    %edx,%edx
801032d5:	8d 76 00             	lea    0x0(%esi),%esi
    sum += addr[i];
801032d8:	0f b6 88 00 00 00 80 	movzbl -0x80000000(%eax),%ecx
  for(i=0; i<len; i++)
801032df:	83 c0 01             	add    $0x1,%eax
    sum += addr[i];
801032e2:	01 ca                	add    %ecx,%edx
  for(i=0; i<len; i++)
801032e4:	39 c7                	cmp    %eax,%edi
801032e6:	75 f0                	jne    801032d8 <mpinit+0xa8>
  if(sum((uchar*)conf, conf->length) != 0)
801032e8:	84 d2                	test   %dl,%dl
801032ea:	0f 85 c0 00 00 00    	jne    801033b0 <mpinit+0x180>
  struct mpioapic *ioapic;

  if((conf = mpconfig(&mp)) == 0)
    panic("Expect to run on an SMP");
  ismp = 1;
  lapic = (uint*)conf->lapicaddr;
801032f0:	8b 86 24 00 00 80    	mov    -0x7fffffdc(%esi),%eax
801032f6:	a3 80 26 11 80       	mov    %eax,0x80112680
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
801032fb:	0f b7 96 04 00 00 80 	movzwl -0x7ffffffc(%esi),%edx
80103302:	8d 86 2c 00 00 80    	lea    -0x7fffffd4(%esi),%eax
  ismp = 1;
80103308:	be 01 00 00 00       	mov    $0x1,%esi
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010330d:	03 55 e4             	add    -0x1c(%ebp),%edx
80103310:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
80103313:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103317:	90                   	nop
80103318:	39 d0                	cmp    %edx,%eax
8010331a:	73 15                	jae    80103331 <mpinit+0x101>
    switch(*p){
8010331c:	0f b6 08             	movzbl (%eax),%ecx
8010331f:	80 f9 02             	cmp    $0x2,%cl
80103322:	74 4c                	je     80103370 <mpinit+0x140>
80103324:	77 3a                	ja     80103360 <mpinit+0x130>
80103326:	84 c9                	test   %cl,%cl
80103328:	74 56                	je     80103380 <mpinit+0x150>
      p += sizeof(struct mpioapic);
      continue;
    case MPBUS:
    case MPIOINTR:
    case MPLINTR:
      p += 8;
8010332a:	83 c0 08             	add    $0x8,%eax
  for(p=(uchar*)(conf+1), e=(uchar*)conf+conf->length; p<e; ){
8010332d:	39 d0                	cmp    %edx,%eax
8010332f:	72 eb                	jb     8010331c <mpinit+0xec>
    default:
      ismp = 0;
      break;
    }
  }
  if(!ismp)
80103331:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80103334:	85 f6                	test   %esi,%esi
80103336:	0f 84 d9 00 00 00    	je     80103415 <mpinit+0x1e5>
    panic("Didn't find a suitable machine");

  if(mp->imcrp){
8010333c:	80 7b 0c 00          	cmpb   $0x0,0xc(%ebx)
80103340:	74 15                	je     80103357 <mpinit+0x127>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103342:	b8 70 00 00 00       	mov    $0x70,%eax
80103347:	ba 22 00 00 00       	mov    $0x22,%edx
8010334c:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010334d:	ba 23 00 00 00       	mov    $0x23,%edx
80103352:	ec                   	in     (%dx),%al
    // Bochs doesn't support IMCR, so this doesn't run on Bochs.
    // But it would on real hardware.
    outb(0x22, 0x70);   // Select IMCR
    outb(0x23, inb(0x23) | 1);  // Mask external interrupts.
80103353:	83 c8 01             	or     $0x1,%eax
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80103356:	ee                   	out    %al,(%dx)
  }
}
80103357:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010335a:	5b                   	pop    %ebx
8010335b:	5e                   	pop    %esi
8010335c:	5f                   	pop    %edi
8010335d:	5d                   	pop    %ebp
8010335e:	c3                   	ret    
8010335f:	90                   	nop
    switch(*p){
80103360:	83 e9 03             	sub    $0x3,%ecx
80103363:	80 f9 01             	cmp    $0x1,%cl
80103366:	76 c2                	jbe    8010332a <mpinit+0xfa>
80103368:	31 f6                	xor    %esi,%esi
8010336a:	eb ac                	jmp    80103318 <mpinit+0xe8>
8010336c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
      ioapicid = ioapic->apicno;
80103370:	0f b6 48 01          	movzbl 0x1(%eax),%ecx
      p += sizeof(struct mpioapic);
80103374:	83 c0 08             	add    $0x8,%eax
      ioapicid = ioapic->apicno;
80103377:	88 0d 80 27 11 80    	mov    %cl,0x80112780
      continue;
8010337d:	eb 99                	jmp    80103318 <mpinit+0xe8>
8010337f:	90                   	nop
      if(ncpu < NCPU) {
80103380:	8b 0d 84 27 11 80    	mov    0x80112784,%ecx
80103386:	83 f9 07             	cmp    $0x7,%ecx
80103389:	7f 19                	jg     801033a4 <mpinit+0x174>
        cpus[ncpu].apicid = proc->apicid;  // apicid may differ from ncpu
8010338b:	69 f9 b0 00 00 00    	imul   $0xb0,%ecx,%edi
80103391:	0f b6 58 01          	movzbl 0x1(%eax),%ebx
        ncpu++;
80103395:	83 c1 01             	add    $0x1,%ecx
80103398:	89 0d 84 27 11 80    	mov    %ecx,0x80112784
        cpus[ncpu].apicid = proc->apicid;  // apicid may differ from ncpu
8010339e:	88 9f a0 27 11 80    	mov    %bl,-0x7feed860(%edi)
      p += sizeof(struct mpproc);
801033a4:	83 c0 14             	add    $0x14,%eax
      continue;
801033a7:	e9 6c ff ff ff       	jmp    80103318 <mpinit+0xe8>
801033ac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    panic("Expect to run on an SMP");
801033b0:	83 ec 0c             	sub    $0xc,%esp
801033b3:	68 42 7e 10 80       	push   $0x80107e42
801033b8:	e8 c3 cf ff ff       	call   80100380 <panic>
801033bd:	8d 76 00             	lea    0x0(%esi),%esi
{
801033c0:	bb 00 00 0f 80       	mov    $0x800f0000,%ebx
801033c5:	eb 13                	jmp    801033da <mpinit+0x1aa>
801033c7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801033ce:	66 90                	xchg   %ax,%ax
  for(p = addr; p < e; p += sizeof(struct mp))
801033d0:	89 f3                	mov    %esi,%ebx
801033d2:	81 fe 00 00 10 80    	cmp    $0x80100000,%esi
801033d8:	74 d6                	je     801033b0 <mpinit+0x180>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
801033da:	83 ec 04             	sub    $0x4,%esp
801033dd:	8d 73 10             	lea    0x10(%ebx),%esi
801033e0:	6a 04                	push   $0x4
801033e2:	68 38 7e 10 80       	push   $0x80107e38
801033e7:	53                   	push   %ebx
801033e8:	e8 73 18 00 00       	call   80104c60 <memcmp>
801033ed:	83 c4 10             	add    $0x10,%esp
801033f0:	85 c0                	test   %eax,%eax
801033f2:	75 dc                	jne    801033d0 <mpinit+0x1a0>
801033f4:	89 da                	mov    %ebx,%edx
801033f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801033fd:	8d 76 00             	lea    0x0(%esi),%esi
    sum += addr[i];
80103400:	0f b6 0a             	movzbl (%edx),%ecx
  for(i=0; i<len; i++)
80103403:	83 c2 01             	add    $0x1,%edx
    sum += addr[i];
80103406:	01 c8                	add    %ecx,%eax
  for(i=0; i<len; i++)
80103408:	39 d6                	cmp    %edx,%esi
8010340a:	75 f4                	jne    80103400 <mpinit+0x1d0>
    if(memcmp(p, "_MP_", 4) == 0 && sum(p, sizeof(struct mp)) == 0)
8010340c:	84 c0                	test   %al,%al
8010340e:	75 c0                	jne    801033d0 <mpinit+0x1a0>
80103410:	e9 6b fe ff ff       	jmp    80103280 <mpinit+0x50>
    panic("Didn't find a suitable machine");
80103415:	83 ec 0c             	sub    $0xc,%esp
80103418:	68 5c 7e 10 80       	push   $0x80107e5c
8010341d:	e8 5e cf ff ff       	call   80100380 <panic>
80103422:	66 90                	xchg   %ax,%ax
80103424:	66 90                	xchg   %ax,%ax
80103426:	66 90                	xchg   %ax,%ax
80103428:	66 90                	xchg   %ax,%ax
8010342a:	66 90                	xchg   %ax,%ax
8010342c:	66 90                	xchg   %ax,%ax
8010342e:	66 90                	xchg   %ax,%ax

80103430 <picinit>:
80103430:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80103435:	ba 21 00 00 00       	mov    $0x21,%edx
8010343a:	ee                   	out    %al,(%dx)
8010343b:	ba a1 00 00 00       	mov    $0xa1,%edx
80103440:	ee                   	out    %al,(%dx)
picinit(void)
{
  // mask all interrupts
  outb(IO_PIC1+1, 0xFF);
  outb(IO_PIC2+1, 0xFF);
}
80103441:	c3                   	ret    
80103442:	66 90                	xchg   %ax,%ax
80103444:	66 90                	xchg   %ax,%ax
80103446:	66 90                	xchg   %ax,%ax
80103448:	66 90                	xchg   %ax,%ax
8010344a:	66 90                	xchg   %ax,%ax
8010344c:	66 90                	xchg   %ax,%ax
8010344e:	66 90                	xchg   %ax,%ax

80103450 <pipealloc>:
  int writeopen;  // write fd is still open
};

int
pipealloc(struct file **f0, struct file **f1)
{
80103450:	55                   	push   %ebp
80103451:	89 e5                	mov    %esp,%ebp
80103453:	57                   	push   %edi
80103454:	56                   	push   %esi
80103455:	53                   	push   %ebx
80103456:	83 ec 0c             	sub    $0xc,%esp
80103459:	8b 5d 08             	mov    0x8(%ebp),%ebx
8010345c:	8b 75 0c             	mov    0xc(%ebp),%esi
  struct pipe *p;

  p = 0;
  *f0 = *f1 = 0;
8010345f:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
80103465:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  if((*f0 = filealloc()) == 0 || (*f1 = filealloc()) == 0)
8010346b:	e8 c0 d9 ff ff       	call   80100e30 <filealloc>
80103470:	89 03                	mov    %eax,(%ebx)
80103472:	85 c0                	test   %eax,%eax
80103474:	0f 84 a8 00 00 00    	je     80103522 <pipealloc+0xd2>
8010347a:	e8 b1 d9 ff ff       	call   80100e30 <filealloc>
8010347f:	89 06                	mov    %eax,(%esi)
80103481:	85 c0                	test   %eax,%eax
80103483:	0f 84 87 00 00 00    	je     80103510 <pipealloc+0xc0>
    goto bad;
  if((p = (struct pipe*)kalloc()) == 0)
80103489:	e8 12 f2 ff ff       	call   801026a0 <kalloc>
8010348e:	89 c7                	mov    %eax,%edi
80103490:	85 c0                	test   %eax,%eax
80103492:	0f 84 b0 00 00 00    	je     80103548 <pipealloc+0xf8>
    goto bad;
  p->readopen = 1;
80103498:	c7 80 3c 02 00 00 01 	movl   $0x1,0x23c(%eax)
8010349f:	00 00 00 
  p->writeopen = 1;
  p->nwrite = 0;
  p->nread = 0;
  initlock(&p->lock, "pipe");
801034a2:	83 ec 08             	sub    $0x8,%esp
  p->writeopen = 1;
801034a5:	c7 80 40 02 00 00 01 	movl   $0x1,0x240(%eax)
801034ac:	00 00 00 
  p->nwrite = 0;
801034af:	c7 80 38 02 00 00 00 	movl   $0x0,0x238(%eax)
801034b6:	00 00 00 
  p->nread = 0;
801034b9:	c7 80 34 02 00 00 00 	movl   $0x0,0x234(%eax)
801034c0:	00 00 00 
  initlock(&p->lock, "pipe");
801034c3:	68 7b 7e 10 80       	push   $0x80107e7b
801034c8:	50                   	push   %eax
801034c9:	e8 c2 14 00 00       	call   80104990 <initlock>
  (*f0)->type = FD_PIPE;
801034ce:	8b 03                	mov    (%ebx),%eax
  (*f0)->pipe = p;
  (*f1)->type = FD_PIPE;
  (*f1)->readable = 0;
  (*f1)->writable = 1;
  (*f1)->pipe = p;
  return 0;
801034d0:	83 c4 10             	add    $0x10,%esp
  (*f0)->type = FD_PIPE;
801034d3:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  (*f0)->readable = 1;
801034d9:	8b 03                	mov    (%ebx),%eax
801034db:	c6 40 08 01          	movb   $0x1,0x8(%eax)
  (*f0)->writable = 0;
801034df:	8b 03                	mov    (%ebx),%eax
801034e1:	c6 40 09 00          	movb   $0x0,0x9(%eax)
  (*f0)->pipe = p;
801034e5:	8b 03                	mov    (%ebx),%eax
801034e7:	89 78 0c             	mov    %edi,0xc(%eax)
  (*f1)->type = FD_PIPE;
801034ea:	8b 06                	mov    (%esi),%eax
801034ec:	c7 00 01 00 00 00    	movl   $0x1,(%eax)
  (*f1)->readable = 0;
801034f2:	8b 06                	mov    (%esi),%eax
801034f4:	c6 40 08 00          	movb   $0x0,0x8(%eax)
  (*f1)->writable = 1;
801034f8:	8b 06                	mov    (%esi),%eax
801034fa:	c6 40 09 01          	movb   $0x1,0x9(%eax)
  (*f1)->pipe = p;
801034fe:	8b 06                	mov    (%esi),%eax
80103500:	89 78 0c             	mov    %edi,0xc(%eax)
  if(*f0)
    fileclose(*f0);
  if(*f1)
    fileclose(*f1);
  return -1;
}
80103503:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80103506:	31 c0                	xor    %eax,%eax
}
80103508:	5b                   	pop    %ebx
80103509:	5e                   	pop    %esi
8010350a:	5f                   	pop    %edi
8010350b:	5d                   	pop    %ebp
8010350c:	c3                   	ret    
8010350d:	8d 76 00             	lea    0x0(%esi),%esi
  if(*f0)
80103510:	8b 03                	mov    (%ebx),%eax
80103512:	85 c0                	test   %eax,%eax
80103514:	74 1e                	je     80103534 <pipealloc+0xe4>
    fileclose(*f0);
80103516:	83 ec 0c             	sub    $0xc,%esp
80103519:	50                   	push   %eax
8010351a:	e8 d1 d9 ff ff       	call   80100ef0 <fileclose>
8010351f:	83 c4 10             	add    $0x10,%esp
  if(*f1)
80103522:	8b 06                	mov    (%esi),%eax
80103524:	85 c0                	test   %eax,%eax
80103526:	74 0c                	je     80103534 <pipealloc+0xe4>
    fileclose(*f1);
80103528:	83 ec 0c             	sub    $0xc,%esp
8010352b:	50                   	push   %eax
8010352c:	e8 bf d9 ff ff       	call   80100ef0 <fileclose>
80103531:	83 c4 10             	add    $0x10,%esp
}
80103534:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return -1;
80103537:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
8010353c:	5b                   	pop    %ebx
8010353d:	5e                   	pop    %esi
8010353e:	5f                   	pop    %edi
8010353f:	5d                   	pop    %ebp
80103540:	c3                   	ret    
80103541:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  if(*f0)
80103548:	8b 03                	mov    (%ebx),%eax
8010354a:	85 c0                	test   %eax,%eax
8010354c:	75 c8                	jne    80103516 <pipealloc+0xc6>
8010354e:	eb d2                	jmp    80103522 <pipealloc+0xd2>

80103550 <pipeclose>:

void
pipeclose(struct pipe *p, int writable)
{
80103550:	55                   	push   %ebp
80103551:	89 e5                	mov    %esp,%ebp
80103553:	56                   	push   %esi
80103554:	53                   	push   %ebx
80103555:	8b 5d 08             	mov    0x8(%ebp),%ebx
80103558:	8b 75 0c             	mov    0xc(%ebp),%esi
  acquire(&p->lock);
8010355b:	83 ec 0c             	sub    $0xc,%esp
8010355e:	53                   	push   %ebx
8010355f:	e8 3c 15 00 00       	call   80104aa0 <acquire>
  if(writable){
80103564:	83 c4 10             	add    $0x10,%esp
80103567:	85 f6                	test   %esi,%esi
80103569:	74 65                	je     801035d0 <pipeclose+0x80>
    p->writeopen = 0;
    wakeup(&p->nread);
8010356b:	83 ec 0c             	sub    $0xc,%esp
8010356e:	8d 83 34 02 00 00    	lea    0x234(%ebx),%eax
    p->writeopen = 0;
80103574:	c7 83 40 02 00 00 00 	movl   $0x0,0x240(%ebx)
8010357b:	00 00 00 
    wakeup(&p->nread);
8010357e:	50                   	push   %eax
8010357f:	e8 3c 0d 00 00       	call   801042c0 <wakeup>
80103584:	83 c4 10             	add    $0x10,%esp
  } else {
    p->readopen = 0;
    wakeup(&p->nwrite);
  }
  if(p->readopen == 0 && p->writeopen == 0){
80103587:	8b 93 3c 02 00 00    	mov    0x23c(%ebx),%edx
8010358d:	85 d2                	test   %edx,%edx
8010358f:	75 0a                	jne    8010359b <pipeclose+0x4b>
80103591:	8b 83 40 02 00 00    	mov    0x240(%ebx),%eax
80103597:	85 c0                	test   %eax,%eax
80103599:	74 15                	je     801035b0 <pipeclose+0x60>
    release(&p->lock);
    kfree((char*)p);
  } else
    release(&p->lock);
8010359b:	89 5d 08             	mov    %ebx,0x8(%ebp)
}
8010359e:	8d 65 f8             	lea    -0x8(%ebp),%esp
801035a1:	5b                   	pop    %ebx
801035a2:	5e                   	pop    %esi
801035a3:	5d                   	pop    %ebp
    release(&p->lock);
801035a4:	e9 17 16 00 00       	jmp    80104bc0 <release>
801035a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    release(&p->lock);
801035b0:	83 ec 0c             	sub    $0xc,%esp
801035b3:	53                   	push   %ebx
801035b4:	e8 07 16 00 00       	call   80104bc0 <release>
    kfree((char*)p);
801035b9:	89 5d 08             	mov    %ebx,0x8(%ebp)
801035bc:	83 c4 10             	add    $0x10,%esp
}
801035bf:	8d 65 f8             	lea    -0x8(%ebp),%esp
801035c2:	5b                   	pop    %ebx
801035c3:	5e                   	pop    %esi
801035c4:	5d                   	pop    %ebp
    kfree((char*)p);
801035c5:	e9 16 ef ff ff       	jmp    801024e0 <kfree>
801035ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    wakeup(&p->nwrite);
801035d0:	83 ec 0c             	sub    $0xc,%esp
801035d3:	8d 83 38 02 00 00    	lea    0x238(%ebx),%eax
    p->readopen = 0;
801035d9:	c7 83 3c 02 00 00 00 	movl   $0x0,0x23c(%ebx)
801035e0:	00 00 00 
    wakeup(&p->nwrite);
801035e3:	50                   	push   %eax
801035e4:	e8 d7 0c 00 00       	call   801042c0 <wakeup>
801035e9:	83 c4 10             	add    $0x10,%esp
801035ec:	eb 99                	jmp    80103587 <pipeclose+0x37>
801035ee:	66 90                	xchg   %ax,%ax

801035f0 <pipewrite>:

//PAGEBREAK: 40
int
pipewrite(struct pipe *p, char *addr, int n)
{
801035f0:	55                   	push   %ebp
801035f1:	89 e5                	mov    %esp,%ebp
801035f3:	57                   	push   %edi
801035f4:	56                   	push   %esi
801035f5:	53                   	push   %ebx
801035f6:	83 ec 28             	sub    $0x28,%esp
801035f9:	8b 5d 08             	mov    0x8(%ebp),%ebx
  int i;

  acquire(&p->lock);
801035fc:	53                   	push   %ebx
801035fd:	e8 9e 14 00 00       	call   80104aa0 <acquire>
  for(i = 0; i < n; i++){
80103602:	8b 45 10             	mov    0x10(%ebp),%eax
80103605:	83 c4 10             	add    $0x10,%esp
80103608:	85 c0                	test   %eax,%eax
8010360a:	0f 8e c0 00 00 00    	jle    801036d0 <pipewrite+0xe0>
80103610:	8b 45 0c             	mov    0xc(%ebp),%eax
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80103613:	8b 8b 38 02 00 00    	mov    0x238(%ebx),%ecx
      if(p->readopen == 0 || myproc()->killed){
        release(&p->lock);
        return -1;
      }
      wakeup(&p->nread);
80103619:	8d bb 34 02 00 00    	lea    0x234(%ebx),%edi
8010361f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80103622:	03 45 10             	add    0x10(%ebp),%eax
80103625:	89 45 e0             	mov    %eax,-0x20(%ebp)
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80103628:	8b 83 34 02 00 00    	mov    0x234(%ebx),%eax
      sleep(&p->nwrite, &p->lock);  //DOC: pipewrite-sleep
8010362e:	8d b3 38 02 00 00    	lea    0x238(%ebx),%esi
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80103634:	89 ca                	mov    %ecx,%edx
80103636:	05 00 02 00 00       	add    $0x200,%eax
8010363b:	39 c1                	cmp    %eax,%ecx
8010363d:	74 3f                	je     8010367e <pipewrite+0x8e>
8010363f:	eb 67                	jmp    801036a8 <pipewrite+0xb8>
80103641:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      if(p->readopen == 0 || myproc()->killed){
80103648:	e8 53 03 00 00       	call   801039a0 <myproc>
8010364d:	8b 48 24             	mov    0x24(%eax),%ecx
80103650:	85 c9                	test   %ecx,%ecx
80103652:	75 34                	jne    80103688 <pipewrite+0x98>
      wakeup(&p->nread);
80103654:	83 ec 0c             	sub    $0xc,%esp
80103657:	57                   	push   %edi
80103658:	e8 63 0c 00 00       	call   801042c0 <wakeup>
      sleep(&p->nwrite, &p->lock);  //DOC: pipewrite-sleep
8010365d:	58                   	pop    %eax
8010365e:	5a                   	pop    %edx
8010365f:	53                   	push   %ebx
80103660:	56                   	push   %esi
80103661:	e8 9a 0b 00 00       	call   80104200 <sleep>
    while(p->nwrite == p->nread + PIPESIZE){  //DOC: pipewrite-full
80103666:	8b 83 34 02 00 00    	mov    0x234(%ebx),%eax
8010366c:	8b 93 38 02 00 00    	mov    0x238(%ebx),%edx
80103672:	83 c4 10             	add    $0x10,%esp
80103675:	05 00 02 00 00       	add    $0x200,%eax
8010367a:	39 c2                	cmp    %eax,%edx
8010367c:	75 2a                	jne    801036a8 <pipewrite+0xb8>
      if(p->readopen == 0 || myproc()->killed){
8010367e:	8b 83 3c 02 00 00    	mov    0x23c(%ebx),%eax
80103684:	85 c0                	test   %eax,%eax
80103686:	75 c0                	jne    80103648 <pipewrite+0x58>
        release(&p->lock);
80103688:	83 ec 0c             	sub    $0xc,%esp
8010368b:	53                   	push   %ebx
8010368c:	e8 2f 15 00 00       	call   80104bc0 <release>
        return -1;
80103691:	83 c4 10             	add    $0x10,%esp
80103694:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
    p->data[p->nwrite++ % PIPESIZE] = addr[i];
  }
  wakeup(&p->nread);  //DOC: pipewrite-wakeup1
  release(&p->lock);
  return n;
}
80103699:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010369c:	5b                   	pop    %ebx
8010369d:	5e                   	pop    %esi
8010369e:	5f                   	pop    %edi
8010369f:	5d                   	pop    %ebp
801036a0:	c3                   	ret    
801036a1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    p->data[p->nwrite++ % PIPESIZE] = addr[i];
801036a8:	8b 75 e4             	mov    -0x1c(%ebp),%esi
801036ab:	8d 4a 01             	lea    0x1(%edx),%ecx
801036ae:	81 e2 ff 01 00 00    	and    $0x1ff,%edx
801036b4:	89 8b 38 02 00 00    	mov    %ecx,0x238(%ebx)
801036ba:	0f b6 06             	movzbl (%esi),%eax
  for(i = 0; i < n; i++){
801036bd:	83 c6 01             	add    $0x1,%esi
801036c0:	89 75 e4             	mov    %esi,-0x1c(%ebp)
    p->data[p->nwrite++ % PIPESIZE] = addr[i];
801036c3:	88 44 13 34          	mov    %al,0x34(%ebx,%edx,1)
  for(i = 0; i < n; i++){
801036c7:	3b 75 e0             	cmp    -0x20(%ebp),%esi
801036ca:	0f 85 58 ff ff ff    	jne    80103628 <pipewrite+0x38>
  wakeup(&p->nread);  //DOC: pipewrite-wakeup1
801036d0:	83 ec 0c             	sub    $0xc,%esp
801036d3:	8d 83 34 02 00 00    	lea    0x234(%ebx),%eax
801036d9:	50                   	push   %eax
801036da:	e8 e1 0b 00 00       	call   801042c0 <wakeup>
  release(&p->lock);
801036df:	89 1c 24             	mov    %ebx,(%esp)
801036e2:	e8 d9 14 00 00       	call   80104bc0 <release>
  return n;
801036e7:	8b 45 10             	mov    0x10(%ebp),%eax
801036ea:	83 c4 10             	add    $0x10,%esp
801036ed:	eb aa                	jmp    80103699 <pipewrite+0xa9>
801036ef:	90                   	nop

801036f0 <piperead>:

int
piperead(struct pipe *p, char *addr, int n)
{
801036f0:	55                   	push   %ebp
801036f1:	89 e5                	mov    %esp,%ebp
801036f3:	57                   	push   %edi
801036f4:	56                   	push   %esi
801036f5:	53                   	push   %ebx
801036f6:	83 ec 18             	sub    $0x18,%esp
801036f9:	8b 75 08             	mov    0x8(%ebp),%esi
801036fc:	8b 7d 0c             	mov    0xc(%ebp),%edi
  int i;

  acquire(&p->lock);
801036ff:	56                   	push   %esi
80103700:	8d 9e 34 02 00 00    	lea    0x234(%esi),%ebx
80103706:	e8 95 13 00 00       	call   80104aa0 <acquire>
  while(p->nread == p->nwrite && p->writeopen){  //DOC: pipe-empty
8010370b:	8b 86 34 02 00 00    	mov    0x234(%esi),%eax
80103711:	83 c4 10             	add    $0x10,%esp
80103714:	39 86 38 02 00 00    	cmp    %eax,0x238(%esi)
8010371a:	74 2f                	je     8010374b <piperead+0x5b>
8010371c:	eb 37                	jmp    80103755 <piperead+0x65>
8010371e:	66 90                	xchg   %ax,%ax
    if(myproc()->killed){
80103720:	e8 7b 02 00 00       	call   801039a0 <myproc>
80103725:	8b 48 24             	mov    0x24(%eax),%ecx
80103728:	85 c9                	test   %ecx,%ecx
8010372a:	0f 85 80 00 00 00    	jne    801037b0 <piperead+0xc0>
      release(&p->lock);
      return -1;
    }
    sleep(&p->nread, &p->lock); //DOC: piperead-sleep
80103730:	83 ec 08             	sub    $0x8,%esp
80103733:	56                   	push   %esi
80103734:	53                   	push   %ebx
80103735:	e8 c6 0a 00 00       	call   80104200 <sleep>
  while(p->nread == p->nwrite && p->writeopen){  //DOC: pipe-empty
8010373a:	8b 86 38 02 00 00    	mov    0x238(%esi),%eax
80103740:	83 c4 10             	add    $0x10,%esp
80103743:	39 86 34 02 00 00    	cmp    %eax,0x234(%esi)
80103749:	75 0a                	jne    80103755 <piperead+0x65>
8010374b:	8b 86 40 02 00 00    	mov    0x240(%esi),%eax
80103751:	85 c0                	test   %eax,%eax
80103753:	75 cb                	jne    80103720 <piperead+0x30>
  }
  for(i = 0; i < n; i++){  //DOC: piperead-copy
80103755:	8b 55 10             	mov    0x10(%ebp),%edx
80103758:	31 db                	xor    %ebx,%ebx
8010375a:	85 d2                	test   %edx,%edx
8010375c:	7f 20                	jg     8010377e <piperead+0x8e>
8010375e:	eb 2c                	jmp    8010378c <piperead+0x9c>
    if(p->nread == p->nwrite)
      break;
    addr[i] = p->data[p->nread++ % PIPESIZE];
80103760:	8d 48 01             	lea    0x1(%eax),%ecx
80103763:	25 ff 01 00 00       	and    $0x1ff,%eax
80103768:	89 8e 34 02 00 00    	mov    %ecx,0x234(%esi)
8010376e:	0f b6 44 06 34       	movzbl 0x34(%esi,%eax,1),%eax
80103773:	88 04 1f             	mov    %al,(%edi,%ebx,1)
  for(i = 0; i < n; i++){  //DOC: piperead-copy
80103776:	83 c3 01             	add    $0x1,%ebx
80103779:	39 5d 10             	cmp    %ebx,0x10(%ebp)
8010377c:	74 0e                	je     8010378c <piperead+0x9c>
    if(p->nread == p->nwrite)
8010377e:	8b 86 34 02 00 00    	mov    0x234(%esi),%eax
80103784:	3b 86 38 02 00 00    	cmp    0x238(%esi),%eax
8010378a:	75 d4                	jne    80103760 <piperead+0x70>
  }
  wakeup(&p->nwrite);  //DOC: piperead-wakeup
8010378c:	83 ec 0c             	sub    $0xc,%esp
8010378f:	8d 86 38 02 00 00    	lea    0x238(%esi),%eax
80103795:	50                   	push   %eax
80103796:	e8 25 0b 00 00       	call   801042c0 <wakeup>
  release(&p->lock);
8010379b:	89 34 24             	mov    %esi,(%esp)
8010379e:	e8 1d 14 00 00       	call   80104bc0 <release>
  return i;
801037a3:	83 c4 10             	add    $0x10,%esp
}
801037a6:	8d 65 f4             	lea    -0xc(%ebp),%esp
801037a9:	89 d8                	mov    %ebx,%eax
801037ab:	5b                   	pop    %ebx
801037ac:	5e                   	pop    %esi
801037ad:	5f                   	pop    %edi
801037ae:	5d                   	pop    %ebp
801037af:	c3                   	ret    
      release(&p->lock);
801037b0:	83 ec 0c             	sub    $0xc,%esp
      return -1;
801037b3:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
      release(&p->lock);
801037b8:	56                   	push   %esi
801037b9:	e8 02 14 00 00       	call   80104bc0 <release>
      return -1;
801037be:	83 c4 10             	add    $0x10,%esp
}
801037c1:	8d 65 f4             	lea    -0xc(%ebp),%esp
801037c4:	89 d8                	mov    %ebx,%eax
801037c6:	5b                   	pop    %ebx
801037c7:	5e                   	pop    %esi
801037c8:	5f                   	pop    %edi
801037c9:	5d                   	pop    %ebp
801037ca:	c3                   	ret    
801037cb:	66 90                	xchg   %ax,%ax
801037cd:	66 90                	xchg   %ax,%ax
801037cf:	90                   	nop

801037d0 <allocproc>:
// If found, change state to EMBRYO and initialize
// state required to run in the kernel.
// Otherwise return 0.
static struct proc*
allocproc(void)
{
801037d0:	55                   	push   %ebp
801037d1:	89 e5                	mov    %esp,%ebp
801037d3:	53                   	push   %ebx
  struct proc *p;
  char *sp;

  acquire(&ptable.lock);

  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801037d4:	bb 54 ac 11 80       	mov    $0x8011ac54,%ebx
{
801037d9:	83 ec 10             	sub    $0x10,%esp
  acquire(&ptable.lock);
801037dc:	68 20 ac 11 80       	push   $0x8011ac20
801037e1:	e8 ba 12 00 00       	call   80104aa0 <acquire>
801037e6:	83 c4 10             	add    $0x10,%esp
801037e9:	eb 17                	jmp    80103802 <allocproc+0x32>
801037eb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801037ef:	90                   	nop
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801037f0:	81 c3 88 00 00 00    	add    $0x88,%ebx
801037f6:	81 fb 54 ce 11 80    	cmp    $0x8011ce54,%ebx
801037fc:	0f 84 7e 00 00 00    	je     80103880 <allocproc+0xb0>
    if(p->state == UNUSED)
80103802:	8b 43 0c             	mov    0xc(%ebx),%eax
80103805:	85 c0                	test   %eax,%eax
80103807:	75 e7                	jne    801037f0 <allocproc+0x20>
  release(&ptable.lock);
  return 0;

found:
  p->state = EMBRYO;
  p->pid = nextpid++;
80103809:	a1 04 b0 10 80       	mov    0x8010b004,%eax
  p->quantum=1;

  release(&ptable.lock);
8010380e:	83 ec 0c             	sub    $0xc,%esp
  p->state = EMBRYO;
80103811:	c7 43 0c 01 00 00 00 	movl   $0x1,0xc(%ebx)
  p->quantum=1;
80103818:	c7 43 7c 01 00 00 00 	movl   $0x1,0x7c(%ebx)
  p->pid = nextpid++;
8010381f:	89 43 10             	mov    %eax,0x10(%ebx)
80103822:	8d 50 01             	lea    0x1(%eax),%edx
  release(&ptable.lock);
80103825:	68 20 ac 11 80       	push   $0x8011ac20
  p->pid = nextpid++;
8010382a:	89 15 04 b0 10 80    	mov    %edx,0x8010b004
  release(&ptable.lock);
80103830:	e8 8b 13 00 00       	call   80104bc0 <release>

  // Allocate kernel stack.
  if((p->kstack = kalloc()) == 0){
80103835:	e8 66 ee ff ff       	call   801026a0 <kalloc>
8010383a:	83 c4 10             	add    $0x10,%esp
8010383d:	89 43 08             	mov    %eax,0x8(%ebx)
80103840:	85 c0                	test   %eax,%eax
80103842:	74 55                	je     80103899 <allocproc+0xc9>
    return 0;
  }
  sp = p->kstack + KSTACKSIZE;

  // Leave room for trap frame.
  sp -= sizeof *p->tf;
80103844:	8d 90 b4 0f 00 00    	lea    0xfb4(%eax),%edx
  sp -= 4;
  *(uint*)sp = (uint)trapret;

  sp -= sizeof *p->context;
  p->context = (struct context*)sp;
  memset(p->context, 0, sizeof *p->context);
8010384a:	83 ec 04             	sub    $0x4,%esp
  sp -= sizeof *p->context;
8010384d:	05 9c 0f 00 00       	add    $0xf9c,%eax
  sp -= sizeof *p->tf;
80103852:	89 53 18             	mov    %edx,0x18(%ebx)
  *(uint*)sp = (uint)trapret;
80103855:	c7 40 14 cf 5f 10 80 	movl   $0x80105fcf,0x14(%eax)
  p->context = (struct context*)sp;
8010385c:	89 43 1c             	mov    %eax,0x1c(%ebx)
  memset(p->context, 0, sizeof *p->context);
8010385f:	6a 14                	push   $0x14
80103861:	6a 00                	push   $0x0
80103863:	50                   	push   %eax
80103864:	e8 a7 13 00 00       	call   80104c10 <memset>
  p->context->eip = (uint)forkret;
80103869:	8b 43 1c             	mov    0x1c(%ebx),%eax

  return p;
8010386c:	83 c4 10             	add    $0x10,%esp
  p->context->eip = (uint)forkret;
8010386f:	c7 40 10 b0 38 10 80 	movl   $0x801038b0,0x10(%eax)
}
80103876:	89 d8                	mov    %ebx,%eax
80103878:	8b 5d fc             	mov    -0x4(%ebp),%ebx
8010387b:	c9                   	leave  
8010387c:	c3                   	ret    
8010387d:	8d 76 00             	lea    0x0(%esi),%esi
  release(&ptable.lock);
80103880:	83 ec 0c             	sub    $0xc,%esp
  return 0;
80103883:	31 db                	xor    %ebx,%ebx
  release(&ptable.lock);
80103885:	68 20 ac 11 80       	push   $0x8011ac20
8010388a:	e8 31 13 00 00       	call   80104bc0 <release>
}
8010388f:	89 d8                	mov    %ebx,%eax
  return 0;
80103891:	83 c4 10             	add    $0x10,%esp
}
80103894:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103897:	c9                   	leave  
80103898:	c3                   	ret    
    p->state = UNUSED;
80103899:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    return 0;
801038a0:	31 db                	xor    %ebx,%ebx
}
801038a2:	89 d8                	mov    %ebx,%eax
801038a4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801038a7:	c9                   	leave  
801038a8:	c3                   	ret    
801038a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801038b0 <forkret>:

// A fork child's very first scheduling by scheduler()
// will swtch here.  "Return" to user space.
void
forkret(void)
{
801038b0:	55                   	push   %ebp
801038b1:	89 e5                	mov    %esp,%ebp
801038b3:	83 ec 14             	sub    $0x14,%esp
  static int first = 1;
  // Still holding ptable.lock from scheduler.
  release(&ptable.lock);
801038b6:	68 20 ac 11 80       	push   $0x8011ac20
801038bb:	e8 00 13 00 00       	call   80104bc0 <release>

  if (first) {
801038c0:	a1 00 b0 10 80       	mov    0x8010b000,%eax
801038c5:	83 c4 10             	add    $0x10,%esp
801038c8:	85 c0                	test   %eax,%eax
801038ca:	75 04                	jne    801038d0 <forkret+0x20>
    iinit(ROOTDEV);
    initlog(ROOTDEV);
  }

  // Return to "caller", actually trapret (see allocproc).
}
801038cc:	c9                   	leave  
801038cd:	c3                   	ret    
801038ce:	66 90                	xchg   %ax,%ax
    first = 0;
801038d0:	c7 05 00 b0 10 80 00 	movl   $0x0,0x8010b000
801038d7:	00 00 00 
    iinit(ROOTDEV);
801038da:	83 ec 0c             	sub    $0xc,%esp
801038dd:	6a 01                	push   $0x1
801038df:	e8 9c dc ff ff       	call   80101580 <iinit>
    initlog(ROOTDEV);
801038e4:	c7 04 24 01 00 00 00 	movl   $0x1,(%esp)
801038eb:	e8 f0 f3 ff ff       	call   80102ce0 <initlog>
}
801038f0:	83 c4 10             	add    $0x10,%esp
801038f3:	c9                   	leave  
801038f4:	c3                   	ret    
801038f5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801038fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80103900 <pinit>:
{
80103900:	55                   	push   %ebp
80103901:	89 e5                	mov    %esp,%ebp
80103903:	83 ec 10             	sub    $0x10,%esp
  initlock(&ptable.lock, "ptable");
80103906:	68 80 7e 10 80       	push   $0x80107e80
8010390b:	68 20 ac 11 80       	push   $0x8011ac20
80103910:	e8 7b 10 00 00       	call   80104990 <initlock>
}
80103915:	83 c4 10             	add    $0x10,%esp
80103918:	c9                   	leave  
80103919:	c3                   	ret    
8010391a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80103920 <mycpu>:
{
80103920:	55                   	push   %ebp
80103921:	89 e5                	mov    %esp,%ebp
80103923:	56                   	push   %esi
80103924:	53                   	push   %ebx
  asm volatile("pushfl; popl %0" : "=r" (eflags));
80103925:	9c                   	pushf  
80103926:	58                   	pop    %eax
  if(readeflags()&FL_IF)
80103927:	f6 c4 02             	test   $0x2,%ah
8010392a:	75 46                	jne    80103972 <mycpu+0x52>
  apicid = lapicid();
8010392c:	e8 df ef ff ff       	call   80102910 <lapicid>
  for (i = 0; i < ncpu; ++i) {
80103931:	8b 35 84 27 11 80    	mov    0x80112784,%esi
80103937:	85 f6                	test   %esi,%esi
80103939:	7e 2a                	jle    80103965 <mycpu+0x45>
8010393b:	31 d2                	xor    %edx,%edx
8010393d:	eb 08                	jmp    80103947 <mycpu+0x27>
8010393f:	90                   	nop
80103940:	83 c2 01             	add    $0x1,%edx
80103943:	39 f2                	cmp    %esi,%edx
80103945:	74 1e                	je     80103965 <mycpu+0x45>
    if (cpus[i].apicid == apicid)
80103947:	69 ca b0 00 00 00    	imul   $0xb0,%edx,%ecx
8010394d:	0f b6 99 a0 27 11 80 	movzbl -0x7feed860(%ecx),%ebx
80103954:	39 c3                	cmp    %eax,%ebx
80103956:	75 e8                	jne    80103940 <mycpu+0x20>
}
80103958:	8d 65 f8             	lea    -0x8(%ebp),%esp
      return &cpus[i];
8010395b:	8d 81 a0 27 11 80    	lea    -0x7feed860(%ecx),%eax
}
80103961:	5b                   	pop    %ebx
80103962:	5e                   	pop    %esi
80103963:	5d                   	pop    %ebp
80103964:	c3                   	ret    
  panic("unknown apicid\n");
80103965:	83 ec 0c             	sub    $0xc,%esp
80103968:	68 87 7e 10 80       	push   $0x80107e87
8010396d:	e8 0e ca ff ff       	call   80100380 <panic>
    panic("mycpu called with interrupts enabled\n");
80103972:	83 ec 0c             	sub    $0xc,%esp
80103975:	68 8c 7f 10 80       	push   $0x80107f8c
8010397a:	e8 01 ca ff ff       	call   80100380 <panic>
8010397f:	90                   	nop

80103980 <cpuid>:
cpuid() {
80103980:	55                   	push   %ebp
80103981:	89 e5                	mov    %esp,%ebp
80103983:	83 ec 08             	sub    $0x8,%esp
  return mycpu()-cpus;
80103986:	e8 95 ff ff ff       	call   80103920 <mycpu>
}
8010398b:	c9                   	leave  
  return mycpu()-cpus;
8010398c:	2d a0 27 11 80       	sub    $0x801127a0,%eax
80103991:	c1 f8 04             	sar    $0x4,%eax
80103994:	69 c0 a3 8b 2e ba    	imul   $0xba2e8ba3,%eax,%eax
}
8010399a:	c3                   	ret    
8010399b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010399f:	90                   	nop

801039a0 <myproc>:
myproc(void) {
801039a0:	55                   	push   %ebp
801039a1:	89 e5                	mov    %esp,%ebp
801039a3:	53                   	push   %ebx
801039a4:	83 ec 04             	sub    $0x4,%esp
  pushcli();
801039a7:	e8 a4 10 00 00       	call   80104a50 <pushcli>
  c = mycpu();
801039ac:	e8 6f ff ff ff       	call   80103920 <mycpu>
  p = c->proc;
801039b1:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
801039b7:	e8 a4 11 00 00       	call   80104b60 <popcli>
}
801039bc:	89 d8                	mov    %ebx,%eax
801039be:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801039c1:	c9                   	leave  
801039c2:	c3                   	ret    
801039c3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801039ca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801039d0 <userinit>:
{
801039d0:	55                   	push   %ebp
801039d1:	89 e5                	mov    %esp,%ebp
801039d3:	53                   	push   %ebx
801039d4:	83 ec 04             	sub    $0x4,%esp
  p = allocproc();
801039d7:	e8 f4 fd ff ff       	call   801037d0 <allocproc>
801039dc:	89 c3                	mov    %eax,%ebx
  initproc = p;
801039de:	a3 54 ce 11 80       	mov    %eax,0x8011ce54
  if((p->pgdir = setupkvm()) == 0)
801039e3:	e8 18 3c 00 00       	call   80107600 <setupkvm>
801039e8:	89 43 04             	mov    %eax,0x4(%ebx)
801039eb:	85 c0                	test   %eax,%eax
801039ed:	0f 84 bd 00 00 00    	je     80103ab0 <userinit+0xe0>
  inituvm(p->pgdir, _binary_initcode_start, (int)_binary_initcode_size);
801039f3:	83 ec 04             	sub    $0x4,%esp
801039f6:	68 2c 00 00 00       	push   $0x2c
801039fb:	68 60 b4 10 80       	push   $0x8010b460
80103a00:	50                   	push   %eax
80103a01:	e8 aa 38 00 00       	call   801072b0 <inituvm>
  memset(p->tf, 0, sizeof(*p->tf));
80103a06:	83 c4 0c             	add    $0xc,%esp
  p->sz = PGSIZE;
80103a09:	c7 03 00 10 00 00    	movl   $0x1000,(%ebx)
  memset(p->tf, 0, sizeof(*p->tf));
80103a0f:	6a 4c                	push   $0x4c
80103a11:	6a 00                	push   $0x0
80103a13:	ff 73 18             	push   0x18(%ebx)
80103a16:	e8 f5 11 00 00       	call   80104c10 <memset>
  p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103a1b:	8b 43 18             	mov    0x18(%ebx),%eax
80103a1e:	ba 1b 00 00 00       	mov    $0x1b,%edx
  safestrcpy(p->name, "initcode", sizeof(p->name));
80103a23:	83 c4 0c             	add    $0xc,%esp
  p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103a26:	b9 23 00 00 00       	mov    $0x23,%ecx
  p->tf->cs = (SEG_UCODE << 3) | DPL_USER;
80103a2b:	66 89 50 3c          	mov    %dx,0x3c(%eax)
  p->tf->ds = (SEG_UDATA << 3) | DPL_USER;
80103a2f:	8b 43 18             	mov    0x18(%ebx),%eax
80103a32:	66 89 48 2c          	mov    %cx,0x2c(%eax)
  p->tf->es = p->tf->ds;
80103a36:	8b 43 18             	mov    0x18(%ebx),%eax
80103a39:	0f b7 50 2c          	movzwl 0x2c(%eax),%edx
80103a3d:	66 89 50 28          	mov    %dx,0x28(%eax)
  p->tf->ss = p->tf->ds;
80103a41:	8b 43 18             	mov    0x18(%ebx),%eax
80103a44:	0f b7 50 2c          	movzwl 0x2c(%eax),%edx
80103a48:	66 89 50 48          	mov    %dx,0x48(%eax)
  p->tf->eflags = FL_IF;
80103a4c:	8b 43 18             	mov    0x18(%ebx),%eax
80103a4f:	c7 40 40 00 02 00 00 	movl   $0x200,0x40(%eax)
  p->tf->esp = PGSIZE;
80103a56:	8b 43 18             	mov    0x18(%ebx),%eax
80103a59:	c7 40 44 00 10 00 00 	movl   $0x1000,0x44(%eax)
  p->tf->eip = 0;  // beginning of initcode.S
80103a60:	8b 43 18             	mov    0x18(%ebx),%eax
80103a63:	c7 40 38 00 00 00 00 	movl   $0x0,0x38(%eax)
  safestrcpy(p->name, "initcode", sizeof(p->name));
80103a6a:	8d 43 6c             	lea    0x6c(%ebx),%eax
80103a6d:	6a 10                	push   $0x10
80103a6f:	68 b0 7e 10 80       	push   $0x80107eb0
80103a74:	50                   	push   %eax
80103a75:	e8 56 13 00 00       	call   80104dd0 <safestrcpy>
  p->cwd = namei("/");
80103a7a:	c7 04 24 b9 7e 10 80 	movl   $0x80107eb9,(%esp)
80103a81:	e8 3a e6 ff ff       	call   801020c0 <namei>
80103a86:	89 43 68             	mov    %eax,0x68(%ebx)
  acquire(&ptable.lock);
80103a89:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80103a90:	e8 0b 10 00 00       	call   80104aa0 <acquire>
  p->state = RUNNABLE;
80103a95:	c7 43 0c 03 00 00 00 	movl   $0x3,0xc(%ebx)
  release(&ptable.lock);
80103a9c:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80103aa3:	e8 18 11 00 00       	call   80104bc0 <release>
}
80103aa8:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103aab:	83 c4 10             	add    $0x10,%esp
80103aae:	c9                   	leave  
80103aaf:	c3                   	ret    
    panic("userinit: out of memory?");
80103ab0:	83 ec 0c             	sub    $0xc,%esp
80103ab3:	68 97 7e 10 80       	push   $0x80107e97
80103ab8:	e8 c3 c8 ff ff       	call   80100380 <panic>
80103abd:	8d 76 00             	lea    0x0(%esi),%esi

80103ac0 <growproc>:
{
80103ac0:	55                   	push   %ebp
80103ac1:	89 e5                	mov    %esp,%ebp
80103ac3:	56                   	push   %esi
80103ac4:	53                   	push   %ebx
80103ac5:	8b 75 08             	mov    0x8(%ebp),%esi
  pushcli();
80103ac8:	e8 83 0f 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80103acd:	e8 4e fe ff ff       	call   80103920 <mycpu>
  p = c->proc;
80103ad2:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103ad8:	e8 83 10 00 00       	call   80104b60 <popcli>
  sz = curproc->sz;
80103add:	8b 03                	mov    (%ebx),%eax
  if(n > 0){
80103adf:	85 f6                	test   %esi,%esi
80103ae1:	7f 1d                	jg     80103b00 <growproc+0x40>
  } else if(n < 0){
80103ae3:	75 3b                	jne    80103b20 <growproc+0x60>
  switchuvm(curproc);
80103ae5:	83 ec 0c             	sub    $0xc,%esp
  curproc->sz = sz;
80103ae8:	89 03                	mov    %eax,(%ebx)
  switchuvm(curproc);
80103aea:	53                   	push   %ebx
80103aeb:	e8 b0 36 00 00       	call   801071a0 <switchuvm>
  return 0;
80103af0:	83 c4 10             	add    $0x10,%esp
80103af3:	31 c0                	xor    %eax,%eax
}
80103af5:	8d 65 f8             	lea    -0x8(%ebp),%esp
80103af8:	5b                   	pop    %ebx
80103af9:	5e                   	pop    %esi
80103afa:	5d                   	pop    %ebp
80103afb:	c3                   	ret    
80103afc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if((sz = allocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103b00:	83 ec 04             	sub    $0x4,%esp
80103b03:	01 c6                	add    %eax,%esi
80103b05:	56                   	push   %esi
80103b06:	50                   	push   %eax
80103b07:	ff 73 04             	push   0x4(%ebx)
80103b0a:	e8 11 39 00 00       	call   80107420 <allocuvm>
80103b0f:	83 c4 10             	add    $0x10,%esp
80103b12:	85 c0                	test   %eax,%eax
80103b14:	75 cf                	jne    80103ae5 <growproc+0x25>
      return -1;
80103b16:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80103b1b:	eb d8                	jmp    80103af5 <growproc+0x35>
80103b1d:	8d 76 00             	lea    0x0(%esi),%esi
    if((sz = deallocuvm(curproc->pgdir, sz, sz + n)) == 0)
80103b20:	83 ec 04             	sub    $0x4,%esp
80103b23:	01 c6                	add    %eax,%esi
80103b25:	56                   	push   %esi
80103b26:	50                   	push   %eax
80103b27:	ff 73 04             	push   0x4(%ebx)
80103b2a:	e8 21 3a 00 00       	call   80107550 <deallocuvm>
80103b2f:	83 c4 10             	add    $0x10,%esp
80103b32:	85 c0                	test   %eax,%eax
80103b34:	75 af                	jne    80103ae5 <growproc+0x25>
80103b36:	eb de                	jmp    80103b16 <growproc+0x56>
80103b38:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103b3f:	90                   	nop

80103b40 <fork>:
{
80103b40:	55                   	push   %ebp
80103b41:	89 e5                	mov    %esp,%ebp
80103b43:	57                   	push   %edi
80103b44:	56                   	push   %esi
80103b45:	53                   	push   %ebx
80103b46:	83 ec 1c             	sub    $0x1c,%esp
  pushcli();
80103b49:	e8 02 0f 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80103b4e:	e8 cd fd ff ff       	call   80103920 <mycpu>
  p = c->proc;
80103b53:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103b59:	e8 02 10 00 00       	call   80104b60 <popcli>
  if((np = allocproc()) == 0){
80103b5e:	e8 6d fc ff ff       	call   801037d0 <allocproc>
80103b63:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80103b66:	85 c0                	test   %eax,%eax
80103b68:	0f 84 d7 00 00 00    	je     80103c45 <fork+0x105>
  if((np->pgdir = copyuvm(curproc->pgdir, curproc->sz)) == 0){
80103b6e:	83 ec 08             	sub    $0x8,%esp
80103b71:	ff 33                	push   (%ebx)
80103b73:	89 c7                	mov    %eax,%edi
80103b75:	ff 73 04             	push   0x4(%ebx)
80103b78:	e8 73 3b 00 00       	call   801076f0 <copyuvm>
80103b7d:	83 c4 10             	add    $0x10,%esp
80103b80:	89 47 04             	mov    %eax,0x4(%edi)
80103b83:	85 c0                	test   %eax,%eax
80103b85:	0f 84 c1 00 00 00    	je     80103c4c <fork+0x10c>
  np->sz = curproc->sz;
80103b8b:	8b 03                	mov    (%ebx),%eax
80103b8d:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  *np->tf = *curproc->tf;
80103b90:	b9 13 00 00 00       	mov    $0x13,%ecx
  np->sz = curproc->sz;
80103b95:	89 07                	mov    %eax,(%edi)
  np->parent = curproc;
80103b97:	89 f8                	mov    %edi,%eax
80103b99:	89 5f 14             	mov    %ebx,0x14(%edi)
  *np->tf = *curproc->tf;
80103b9c:	8b 7f 18             	mov    0x18(%edi),%edi
80103b9f:	8b 73 18             	mov    0x18(%ebx),%esi
80103ba2:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  np->tf->eax = 0;
80103ba4:	89 c1                	mov    %eax,%ecx
  for(i = 0; i < NOFILE; i++)
80103ba6:	31 f6                	xor    %esi,%esi
  np->tf->eax = 0;
80103ba8:	8b 40 18             	mov    0x18(%eax),%eax
80103bab:	c7 40 1c 00 00 00 00 	movl   $0x0,0x1c(%eax)
  np->quantum = 1;
80103bb2:	c7 41 7c 01 00 00 00 	movl   $0x1,0x7c(%ecx)
  np->time_elapsed=0;
80103bb9:	c7 81 80 00 00 00 00 	movl   $0x0,0x80(%ecx)
80103bc0:	00 00 00 
  np->prior = 2; // default priority 2
80103bc3:	c7 81 84 00 00 00 02 	movl   $0x2,0x84(%ecx)
80103bca:	00 00 00 
  for(i = 0; i < NOFILE; i++)
80103bcd:	8d 76 00             	lea    0x0(%esi),%esi
    if(curproc->ofile[i])
80103bd0:	8b 44 b3 28          	mov    0x28(%ebx,%esi,4),%eax
80103bd4:	85 c0                	test   %eax,%eax
80103bd6:	74 13                	je     80103beb <fork+0xab>
      np->ofile[i] = filedup(curproc->ofile[i]);
80103bd8:	83 ec 0c             	sub    $0xc,%esp
80103bdb:	50                   	push   %eax
80103bdc:	e8 bf d2 ff ff       	call   80100ea0 <filedup>
80103be1:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80103be4:	83 c4 10             	add    $0x10,%esp
80103be7:	89 44 b2 28          	mov    %eax,0x28(%edx,%esi,4)
  for(i = 0; i < NOFILE; i++)
80103beb:	83 c6 01             	add    $0x1,%esi
80103bee:	83 fe 10             	cmp    $0x10,%esi
80103bf1:	75 dd                	jne    80103bd0 <fork+0x90>
  np->cwd = idup(curproc->cwd);
80103bf3:	83 ec 0c             	sub    $0xc,%esp
80103bf6:	ff 73 68             	push   0x68(%ebx)
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103bf9:	83 c3 6c             	add    $0x6c,%ebx
  np->cwd = idup(curproc->cwd);
80103bfc:	e8 6f db ff ff       	call   80101770 <idup>
80103c01:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103c04:	83 c4 0c             	add    $0xc,%esp
  np->cwd = idup(curproc->cwd);
80103c07:	89 47 68             	mov    %eax,0x68(%edi)
  safestrcpy(np->name, curproc->name, sizeof(curproc->name));
80103c0a:	8d 47 6c             	lea    0x6c(%edi),%eax
80103c0d:	6a 10                	push   $0x10
80103c0f:	53                   	push   %ebx
80103c10:	50                   	push   %eax
80103c11:	e8 ba 11 00 00       	call   80104dd0 <safestrcpy>
  pid = np->pid;
80103c16:	8b 5f 10             	mov    0x10(%edi),%ebx
  acquire(&ptable.lock);
80103c19:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80103c20:	e8 7b 0e 00 00       	call   80104aa0 <acquire>
  np->state = RUNNABLE;
80103c25:	c7 47 0c 03 00 00 00 	movl   $0x3,0xc(%edi)
  release(&ptable.lock);
80103c2c:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80103c33:	e8 88 0f 00 00       	call   80104bc0 <release>
  return pid;
80103c38:	83 c4 10             	add    $0x10,%esp
}
80103c3b:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103c3e:	89 d8                	mov    %ebx,%eax
80103c40:	5b                   	pop    %ebx
80103c41:	5e                   	pop    %esi
80103c42:	5f                   	pop    %edi
80103c43:	5d                   	pop    %ebp
80103c44:	c3                   	ret    
    return -1;
80103c45:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80103c4a:	eb ef                	jmp    80103c3b <fork+0xfb>
    kfree(np->kstack);
80103c4c:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
80103c4f:	83 ec 0c             	sub    $0xc,%esp
80103c52:	ff 73 08             	push   0x8(%ebx)
80103c55:	e8 86 e8 ff ff       	call   801024e0 <kfree>
    np->kstack = 0;
80103c5a:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
    return -1;
80103c61:	83 c4 10             	add    $0x10,%esp
    np->state = UNUSED;
80103c64:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
    return -1;
80103c6b:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80103c70:	eb c9                	jmp    80103c3b <fork+0xfb>
80103c72:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103c79:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80103c80 <set_priority>:
int set_priority(int pid, int prior){
80103c80:	55                   	push   %ebp
80103c81:	89 e5                	mov    %esp,%ebp
80103c83:	53                   	push   %ebx
80103c84:	83 ec 10             	sub    $0x10,%esp
80103c87:	8b 5d 08             	mov    0x8(%ebp),%ebx
	acquire(&ptable.lock);
80103c8a:	68 20 ac 11 80       	push   $0x8011ac20
80103c8f:	e8 0c 0e 00 00       	call   80104aa0 <acquire>
80103c94:	83 c4 10             	add    $0x10,%esp
	for(p=ptable.proc;p<&ptable.proc[NPROC];p++){
80103c97:	b8 54 ac 11 80       	mov    $0x8011ac54,%eax
80103c9c:	eb 0e                	jmp    80103cac <set_priority+0x2c>
80103c9e:	66 90                	xchg   %ax,%ax
80103ca0:	05 88 00 00 00       	add    $0x88,%eax
80103ca5:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
80103caa:	74 24                	je     80103cd0 <set_priority+0x50>
		if(p->pid==pid)
80103cac:	39 58 10             	cmp    %ebx,0x10(%eax)
80103caf:	75 ef                	jne    80103ca0 <set_priority+0x20>
		p->prior=prior;
80103cb1:	8b 55 0c             	mov    0xc(%ebp),%edx
80103cb4:	89 90 84 00 00 00    	mov    %edx,0x84(%eax)
	release(&ptable.lock);
80103cba:	83 ec 0c             	sub    $0xc,%esp
80103cbd:	68 20 ac 11 80       	push   $0x8011ac20
80103cc2:	e8 f9 0e 00 00       	call   80104bc0 <release>
}
80103cc7:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80103cca:	31 c0                	xor    %eax,%eax
80103ccc:	c9                   	leave  
80103ccd:	c3                   	ret    
80103cce:	66 90                	xchg   %ax,%ax
	if(p->pid==pid){
80103cd0:	39 1d 64 ce 11 80    	cmp    %ebx,0x8011ce64
80103cd6:	74 d9                	je     80103cb1 <set_priority+0x31>
    cprintf("do not find pid\n");
80103cd8:	83 ec 0c             	sub    $0xc,%esp
80103cdb:	68 bb 7e 10 80       	push   $0x80107ebb
80103ce0:	e8 bb c9 ff ff       	call   801006a0 <cprintf>
80103ce5:	83 c4 10             	add    $0x10,%esp
80103ce8:	eb d0                	jmp    80103cba <set_priority+0x3a>
80103cea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80103cf0 <scheduler>:
{
80103cf0:	55                   	push   %ebp
80103cf1:	89 e5                	mov    %esp,%ebp
80103cf3:	57                   	push   %edi
80103cf4:	bf 60 ce 11 80       	mov    $0x8011ce60,%edi
80103cf9:	56                   	push   %esi
80103cfa:	53                   	push   %ebx
80103cfb:	83 ec 1c             	sub    $0x1c,%esp
  struct cpu *c = mycpu();
80103cfe:	e8 1d fc ff ff       	call   80103920 <mycpu>
  c->proc = 0;
80103d03:	c7 80 ac 00 00 00 00 	movl   $0x0,0xac(%eax)
80103d0a:	00 00 00 
  struct cpu *c = mycpu();
80103d0d:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  c->proc = 0;
80103d10:	83 c0 04             	add    $0x4,%eax
80103d13:	89 45 e0             	mov    %eax,-0x20(%ebp)
80103d16:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103d1d:	8d 76 00             	lea    0x0(%esi),%esi
  asm volatile("sti");
80103d20:	fb                   	sti    
    acquire(&ptable.lock);
80103d21:	83 ec 0c             	sub    $0xc,%esp
    for(i=0; i<NPROC;i++){
80103d24:	31 f6                	xor    %esi,%esi
    acquire(&ptable.lock);
80103d26:	68 20 ac 11 80       	push   $0x8011ac20
80103d2b:	e8 70 0d 00 00       	call   80104aa0 <acquire>
80103d30:	83 c4 10             	add    $0x10,%esp
      if(p->state != RUNNABLE)
80103d33:	69 c6 88 00 00 00    	imul   $0x88,%esi,%eax
      j=(i+1)%NPROC;
80103d39:	8d 5e 01             	lea    0x1(%esi),%ebx
      if(p->state != RUNNABLE)
80103d3c:	83 b8 60 ac 11 80 03 	cmpl   $0x3,-0x7fee53a0(%eax)
80103d43:	74 1b                	je     80103d60 <scheduler+0x70>
80103d45:	89 de                	mov    %ebx,%esi
    for(i=0; i<NPROC;i++){
80103d47:	83 fb 40             	cmp    $0x40,%ebx
80103d4a:	75 e7                	jne    80103d33 <scheduler+0x43>
    release(&ptable.lock);
80103d4c:	83 ec 0c             	sub    $0xc,%esp
80103d4f:	68 20 ac 11 80       	push   $0x8011ac20
80103d54:	e8 67 0e 00 00       	call   80104bc0 <release>
  for(;;){
80103d59:	83 c4 10             	add    $0x10,%esp
80103d5c:	eb c2                	jmp    80103d20 <scheduler+0x30>
80103d5e:	66 90                	xchg   %ax,%ax
80103d60:	ba 60 ac 11 80       	mov    $0x8011ac60,%edx
       int highest=3;
80103d65:	b8 03 00 00 00       	mov    $0x3,%eax
80103d6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
	       if(ptable.proc[j].state==RUNNABLE&&ptable.proc[j].prior<highest)
80103d70:	83 3a 03             	cmpl   $0x3,(%edx)
80103d73:	75 08                	jne    80103d7d <scheduler+0x8d>
80103d75:	8b 4a 78             	mov    0x78(%edx),%ecx
80103d78:	39 c8                	cmp    %ecx,%eax
80103d7a:	0f 4f c1             	cmovg  %ecx,%eax
       while(j<NPROC){
80103d7d:	81 c2 88 00 00 00    	add    $0x88,%edx
80103d83:	39 d7                	cmp    %edx,%edi
80103d85:	75 e9                	jne    80103d70 <scheduler+0x80>
      if(ptable.proc[candidate].prior!=highest){
80103d87:	69 d6 88 00 00 00    	imul   $0x88,%esi,%edx
80103d8d:	39 82 d8 ac 11 80    	cmp    %eax,-0x7fee5328(%edx)
80103d93:	75 54                	jne    80103de9 <scheduler+0xf9>
      p=&ptable.proc[candidate];
80103d95:	69 f6 88 00 00 00    	imul   $0x88,%esi,%esi
      c->proc = p;
80103d9b:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
      switchuvm(p);
80103d9e:	83 ec 0c             	sub    $0xc,%esp
      p=&ptable.proc[candidate];
80103da1:	8d 86 54 ac 11 80    	lea    -0x7fee53ac(%esi),%eax
      c->proc = p;
80103da7:	89 81 ac 00 00 00    	mov    %eax,0xac(%ecx)
      switchuvm(p);
80103dad:	50                   	push   %eax
80103dae:	e8 ed 33 00 00       	call   801071a0 <switchuvm>
      swtch(&(c->scheduler), p->context);
80103db3:	58                   	pop    %eax
80103db4:	5a                   	pop    %edx
80103db5:	ff b6 70 ac 11 80    	push   -0x7fee5390(%esi)
80103dbb:	ff 75 e0             	push   -0x20(%ebp)
      p->state = RUNNING;
80103dbe:	c7 86 60 ac 11 80 04 	movl   $0x4,-0x7fee53a0(%esi)
80103dc5:	00 00 00 
      c->proc = 0;
80103dc8:	89 de                	mov    %ebx,%esi
      swtch(&(c->scheduler), p->context);
80103dca:	e8 5c 10 00 00       	call   80104e2b <swtch>
      switchkvm();
80103dcf:	e8 bc 33 00 00       	call   80107190 <switchkvm>
      c->proc = 0;
80103dd4:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
80103dd7:	83 c4 10             	add    $0x10,%esp
80103dda:	c7 81 ac 00 00 00 00 	movl   $0x0,0xac(%ecx)
80103de1:	00 00 00 
80103de4:	e9 5e ff ff ff       	jmp    80103d47 <scheduler+0x57>
      j=(i+1)%NPROC;
80103de9:	89 d9                	mov    %ebx,%ecx
80103deb:	c1 f9 1f             	sar    $0x1f,%ecx
80103dee:	c1 e9 1a             	shr    $0x1a,%ecx
80103df1:	8d 14 0b             	lea    (%ebx,%ecx,1),%edx
80103df4:	83 e2 3f             	and    $0x3f,%edx
80103df7:	29 ca                	sub    %ecx,%edx
      while(j!=i){
80103df9:	39 f2                	cmp    %esi,%edx
80103dfb:	74 98                	je     80103d95 <scheduler+0xa5>
80103dfd:	89 5d dc             	mov    %ebx,-0x24(%ebp)
80103e00:	eb 1c                	jmp    80103e1e <scheduler+0x12e>
80103e02:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
	      j=(j+1)%NPROC;
80103e08:	83 c2 01             	add    $0x1,%edx
80103e0b:	89 d1                	mov    %edx,%ecx
80103e0d:	c1 f9 1f             	sar    $0x1f,%ecx
80103e10:	c1 e9 1a             	shr    $0x1a,%ecx
80103e13:	01 ca                	add    %ecx,%edx
80103e15:	83 e2 3f             	and    $0x3f,%edx
80103e18:	29 ca                	sub    %ecx,%edx
      while(j!=i){
80103e1a:	39 f2                	cmp    %esi,%edx
80103e1c:	74 21                	je     80103e3f <scheduler+0x14f>
	      if(ptable.proc[j].state==RUNNABLE&&ptable.proc[j].prior==highest){
80103e1e:	69 ca 88 00 00 00    	imul   $0x88,%edx,%ecx
80103e24:	83 b9 60 ac 11 80 03 	cmpl   $0x3,-0x7fee53a0(%ecx)
80103e2b:	75 db                	jne    80103e08 <scheduler+0x118>
80103e2d:	39 81 d8 ac 11 80    	cmp    %eax,-0x7fee5328(%ecx)
80103e33:	75 d3                	jne    80103e08 <scheduler+0x118>
	      j=(j+1)%NPROC;
80103e35:	8d 5a 01             	lea    0x1(%edx),%ebx
80103e38:	89 d6                	mov    %edx,%esi
80103e3a:	e9 56 ff ff ff       	jmp    80103d95 <scheduler+0xa5>
80103e3f:	8b 5d dc             	mov    -0x24(%ebp),%ebx
80103e42:	e9 4e ff ff ff       	jmp    80103d95 <scheduler+0xa5>
80103e47:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103e4e:	66 90                	xchg   %ax,%ax

80103e50 <sched>:
{
80103e50:	55                   	push   %ebp
80103e51:	89 e5                	mov    %esp,%ebp
80103e53:	57                   	push   %edi
80103e54:	56                   	push   %esi
80103e55:	53                   	push   %ebx
80103e56:	83 ec 0c             	sub    $0xc,%esp
  pushcli();
80103e59:	e8 f2 0b 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80103e5e:	e8 bd fa ff ff       	call   80103920 <mycpu>
  p = c->proc;
80103e63:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80103e69:	e8 f2 0c 00 00       	call   80104b60 <popcli>
  if(!holding(&ptable.lock))
80103e6e:	83 ec 0c             	sub    $0xc,%esp
80103e71:	68 20 ac 11 80       	push   $0x8011ac20
80103e76:	e8 95 0b 00 00       	call   80104a10 <holding>
80103e7b:	83 c4 10             	add    $0x10,%esp
80103e7e:	85 c0                	test   %eax,%eax
80103e80:	0f 84 bb 00 00 00    	je     80103f41 <sched+0xf1>
  if(mycpu()->ncli != 1)
80103e86:	e8 95 fa ff ff       	call   80103920 <mycpu>
80103e8b:	83 b8 a4 00 00 00 01 	cmpl   $0x1,0xa4(%eax)
80103e92:	0f 85 9c 00 00 00    	jne    80103f34 <sched+0xe4>
  if(p->state == RUNNING)
80103e98:	83 7b 0c 04          	cmpl   $0x4,0xc(%ebx)
80103e9c:	0f 84 85 00 00 00    	je     80103f27 <sched+0xd7>
  asm volatile("pushfl; popl %0" : "=r" (eflags));
80103ea2:	9c                   	pushf  
80103ea3:	58                   	pop    %eax
  if(readeflags()&FL_IF)
80103ea4:	f6 c4 02             	test   $0x2,%ah
80103ea7:	75 71                	jne    80103f1a <sched+0xca>
  intena = mycpu()->intena;
80103ea9:	e8 72 fa ff ff       	call   80103920 <mycpu>
80103eae:	8b b0 a8 00 00 00    	mov    0xa8(%eax),%esi
  if(display_enabled)
80103eb4:	a1 20 2d 11 80       	mov    0x80112d20,%eax
80103eb9:	85 c0                	test   %eax,%eax
80103ebb:	75 33                	jne    80103ef0 <sched+0xa0>
  swtch(&p->context, mycpu()->scheduler);
80103ebd:	e8 5e fa ff ff       	call   80103920 <mycpu>
80103ec2:	83 c3 1c             	add    $0x1c,%ebx
80103ec5:	83 ec 08             	sub    $0x8,%esp
80103ec8:	ff 70 04             	push   0x4(%eax)
80103ecb:	53                   	push   %ebx
80103ecc:	e8 5a 0f 00 00       	call   80104e2b <swtch>
  mycpu()->intena = intena;
80103ed1:	e8 4a fa ff ff       	call   80103920 <mycpu>
}
80103ed6:	83 c4 10             	add    $0x10,%esp
  mycpu()->intena = intena;
80103ed9:	89 b0 a8 00 00 00    	mov    %esi,0xa8(%eax)
}
80103edf:	8d 65 f4             	lea    -0xc(%ebp),%esp
80103ee2:	5b                   	pop    %ebx
80103ee3:	5e                   	pop    %esi
80103ee4:	5f                   	pop    %edi
80103ee5:	5d                   	pop    %ebp
80103ee6:	c3                   	ret    
80103ee7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80103eee:	66 90                	xchg   %ax,%ax
  pushcli();
80103ef0:	e8 5b 0b 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80103ef5:	e8 26 fa ff ff       	call   80103920 <mycpu>
  p = c->proc;
80103efa:	8b b8 ac 00 00 00    	mov    0xac(%eax),%edi
  popcli();
80103f00:	e8 5b 0c 00 00       	call   80104b60 <popcli>
	  cprintf("%d -",myproc()->pid);
80103f05:	83 ec 08             	sub    $0x8,%esp
80103f08:	ff 77 10             	push   0x10(%edi)
80103f0b:	68 0c 7f 10 80       	push   $0x80107f0c
80103f10:	e8 8b c7 ff ff       	call   801006a0 <cprintf>
80103f15:	83 c4 10             	add    $0x10,%esp
80103f18:	eb a3                	jmp    80103ebd <sched+0x6d>
    panic("sched interruptible");
80103f1a:	83 ec 0c             	sub    $0xc,%esp
80103f1d:	68 f8 7e 10 80       	push   $0x80107ef8
80103f22:	e8 59 c4 ff ff       	call   80100380 <panic>
    panic("sched running");
80103f27:	83 ec 0c             	sub    $0xc,%esp
80103f2a:	68 ea 7e 10 80       	push   $0x80107eea
80103f2f:	e8 4c c4 ff ff       	call   80100380 <panic>
    panic("sched locks");
80103f34:	83 ec 0c             	sub    $0xc,%esp
80103f37:	68 de 7e 10 80       	push   $0x80107ede
80103f3c:	e8 3f c4 ff ff       	call   80100380 <panic>
    panic("sched ptable.lock");
80103f41:	83 ec 0c             	sub    $0xc,%esp
80103f44:	68 cc 7e 10 80       	push   $0x80107ecc
80103f49:	e8 32 c4 ff ff       	call   80100380 <panic>
80103f4e:	66 90                	xchg   %ax,%ax

80103f50 <exit>:
{
80103f50:	55                   	push   %ebp
80103f51:	89 e5                	mov    %esp,%ebp
80103f53:	57                   	push   %edi
80103f54:	56                   	push   %esi
80103f55:	53                   	push   %ebx
80103f56:	83 ec 0c             	sub    $0xc,%esp
  struct proc *curproc = myproc();
80103f59:	e8 42 fa ff ff       	call   801039a0 <myproc>
  if(curproc == initproc)
80103f5e:	39 05 54 ce 11 80    	cmp    %eax,0x8011ce54
80103f64:	0f 84 07 01 00 00    	je     80104071 <exit+0x121>
80103f6a:	89 c3                	mov    %eax,%ebx
80103f6c:	8d 70 28             	lea    0x28(%eax),%esi
80103f6f:	8d 78 68             	lea    0x68(%eax),%edi
80103f72:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    if(curproc->ofile[fd]){
80103f78:	8b 06                	mov    (%esi),%eax
80103f7a:	85 c0                	test   %eax,%eax
80103f7c:	74 12                	je     80103f90 <exit+0x40>
      fileclose(curproc->ofile[fd]);
80103f7e:	83 ec 0c             	sub    $0xc,%esp
80103f81:	50                   	push   %eax
80103f82:	e8 69 cf ff ff       	call   80100ef0 <fileclose>
      curproc->ofile[fd] = 0;
80103f87:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
80103f8d:	83 c4 10             	add    $0x10,%esp
  for(fd = 0; fd < NOFILE; fd++){
80103f90:	83 c6 04             	add    $0x4,%esi
80103f93:	39 f7                	cmp    %esi,%edi
80103f95:	75 e1                	jne    80103f78 <exit+0x28>
  begin_op();
80103f97:	e8 e4 ed ff ff       	call   80102d80 <begin_op>
  iput(curproc->cwd);
80103f9c:	83 ec 0c             	sub    $0xc,%esp
80103f9f:	ff 73 68             	push   0x68(%ebx)
80103fa2:	e8 29 d9 ff ff       	call   801018d0 <iput>
  end_op();
80103fa7:	e8 44 ee ff ff       	call   80102df0 <end_op>
  curproc->cwd = 0;
80103fac:	c7 43 68 00 00 00 00 	movl   $0x0,0x68(%ebx)
  acquire(&ptable.lock);
80103fb3:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80103fba:	e8 e1 0a 00 00       	call   80104aa0 <acquire>
  wakeup1(curproc->parent);
80103fbf:	8b 53 14             	mov    0x14(%ebx),%edx
80103fc2:	83 c4 10             	add    $0x10,%esp
static void
wakeup1(void *chan)
{
  struct proc *p;

  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fc5:	b8 54 ac 11 80       	mov    $0x8011ac54,%eax
80103fca:	eb 10                	jmp    80103fdc <exit+0x8c>
80103fcc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80103fd0:	05 88 00 00 00       	add    $0x88,%eax
80103fd5:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
80103fda:	74 1e                	je     80103ffa <exit+0xaa>
    if(p->state == SLEEPING && p->chan == chan)
80103fdc:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
80103fe0:	75 ee                	jne    80103fd0 <exit+0x80>
80103fe2:	3b 50 20             	cmp    0x20(%eax),%edx
80103fe5:	75 e9                	jne    80103fd0 <exit+0x80>
      p->state = RUNNABLE;
80103fe7:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
80103fee:	05 88 00 00 00       	add    $0x88,%eax
80103ff3:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
80103ff8:	75 e2                	jne    80103fdc <exit+0x8c>
      p->parent = initproc;
80103ffa:	8b 0d 54 ce 11 80    	mov    0x8011ce54,%ecx
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104000:	ba 54 ac 11 80       	mov    $0x8011ac54,%edx
80104005:	eb 17                	jmp    8010401e <exit+0xce>
80104007:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010400e:	66 90                	xchg   %ax,%ax
80104010:	81 c2 88 00 00 00    	add    $0x88,%edx
80104016:	81 fa 54 ce 11 80    	cmp    $0x8011ce54,%edx
8010401c:	74 3a                	je     80104058 <exit+0x108>
    if(p->parent == curproc){
8010401e:	39 5a 14             	cmp    %ebx,0x14(%edx)
80104021:	75 ed                	jne    80104010 <exit+0xc0>
      if(p->state == ZOMBIE)
80104023:	83 7a 0c 05          	cmpl   $0x5,0xc(%edx)
      p->parent = initproc;
80104027:	89 4a 14             	mov    %ecx,0x14(%edx)
      if(p->state == ZOMBIE)
8010402a:	75 e4                	jne    80104010 <exit+0xc0>
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
8010402c:	b8 54 ac 11 80       	mov    $0x8011ac54,%eax
80104031:	eb 11                	jmp    80104044 <exit+0xf4>
80104033:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104037:	90                   	nop
80104038:	05 88 00 00 00       	add    $0x88,%eax
8010403d:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
80104042:	74 cc                	je     80104010 <exit+0xc0>
    if(p->state == SLEEPING && p->chan == chan)
80104044:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
80104048:	75 ee                	jne    80104038 <exit+0xe8>
8010404a:	3b 48 20             	cmp    0x20(%eax),%ecx
8010404d:	75 e9                	jne    80104038 <exit+0xe8>
      p->state = RUNNABLE;
8010404f:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
80104056:	eb e0                	jmp    80104038 <exit+0xe8>
  curproc->state = ZOMBIE;
80104058:	c7 43 0c 05 00 00 00 	movl   $0x5,0xc(%ebx)
  sched();
8010405f:	e8 ec fd ff ff       	call   80103e50 <sched>
  panic("zombie exit");
80104064:	83 ec 0c             	sub    $0xc,%esp
80104067:	68 1e 7f 10 80       	push   $0x80107f1e
8010406c:	e8 0f c3 ff ff       	call   80100380 <panic>
    panic("init exiting");
80104071:	83 ec 0c             	sub    $0xc,%esp
80104074:	68 11 7f 10 80       	push   $0x80107f11
80104079:	e8 02 c3 ff ff       	call   80100380 <panic>
8010407e:	66 90                	xchg   %ax,%ax

80104080 <wait>:
{
80104080:	55                   	push   %ebp
80104081:	89 e5                	mov    %esp,%ebp
80104083:	56                   	push   %esi
80104084:	53                   	push   %ebx
  pushcli();
80104085:	e8 c6 09 00 00       	call   80104a50 <pushcli>
  c = mycpu();
8010408a:	e8 91 f8 ff ff       	call   80103920 <mycpu>
  p = c->proc;
8010408f:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80104095:	e8 c6 0a 00 00       	call   80104b60 <popcli>
  acquire(&ptable.lock);
8010409a:	83 ec 0c             	sub    $0xc,%esp
8010409d:	68 20 ac 11 80       	push   $0x8011ac20
801040a2:	e8 f9 09 00 00       	call   80104aa0 <acquire>
801040a7:	83 c4 10             	add    $0x10,%esp
    havekids = 0;
801040aa:	31 c0                	xor    %eax,%eax
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801040ac:	bb 54 ac 11 80       	mov    $0x8011ac54,%ebx
801040b1:	eb 13                	jmp    801040c6 <wait+0x46>
801040b3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801040b7:	90                   	nop
801040b8:	81 c3 88 00 00 00    	add    $0x88,%ebx
801040be:	81 fb 54 ce 11 80    	cmp    $0x8011ce54,%ebx
801040c4:	74 1e                	je     801040e4 <wait+0x64>
      if(p->parent != curproc)
801040c6:	39 73 14             	cmp    %esi,0x14(%ebx)
801040c9:	75 ed                	jne    801040b8 <wait+0x38>
      if(p->state == ZOMBIE){
801040cb:	83 7b 0c 05          	cmpl   $0x5,0xc(%ebx)
801040cf:	74 5f                	je     80104130 <wait+0xb0>
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801040d1:	81 c3 88 00 00 00    	add    $0x88,%ebx
      havekids = 1;
801040d7:	b8 01 00 00 00       	mov    $0x1,%eax
    for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801040dc:	81 fb 54 ce 11 80    	cmp    $0x8011ce54,%ebx
801040e2:	75 e2                	jne    801040c6 <wait+0x46>
    if(!havekids || curproc->killed){
801040e4:	85 c0                	test   %eax,%eax
801040e6:	0f 84 9a 00 00 00    	je     80104186 <wait+0x106>
801040ec:	8b 46 24             	mov    0x24(%esi),%eax
801040ef:	85 c0                	test   %eax,%eax
801040f1:	0f 85 8f 00 00 00    	jne    80104186 <wait+0x106>
  pushcli();
801040f7:	e8 54 09 00 00       	call   80104a50 <pushcli>
  c = mycpu();
801040fc:	e8 1f f8 ff ff       	call   80103920 <mycpu>
  p = c->proc;
80104101:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
80104107:	e8 54 0a 00 00       	call   80104b60 <popcli>
  if(p == 0)
8010410c:	85 db                	test   %ebx,%ebx
8010410e:	0f 84 89 00 00 00    	je     8010419d <wait+0x11d>
  p->chan = chan;
80104114:	89 73 20             	mov    %esi,0x20(%ebx)
  p->state = SLEEPING;
80104117:	c7 43 0c 02 00 00 00 	movl   $0x2,0xc(%ebx)
  sched();
8010411e:	e8 2d fd ff ff       	call   80103e50 <sched>
  p->chan = 0;
80104123:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
}
8010412a:	e9 7b ff ff ff       	jmp    801040aa <wait+0x2a>
8010412f:	90                   	nop
        kfree(p->kstack);
80104130:	83 ec 0c             	sub    $0xc,%esp
        pid = p->pid;
80104133:	8b 73 10             	mov    0x10(%ebx),%esi
        kfree(p->kstack);
80104136:	ff 73 08             	push   0x8(%ebx)
80104139:	e8 a2 e3 ff ff       	call   801024e0 <kfree>
        p->kstack = 0;
8010413e:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
        freevm(p->pgdir);
80104145:	5a                   	pop    %edx
80104146:	ff 73 04             	push   0x4(%ebx)
80104149:	e8 32 34 00 00       	call   80107580 <freevm>
        p->pid = 0;
8010414e:	c7 43 10 00 00 00 00 	movl   $0x0,0x10(%ebx)
        p->parent = 0;
80104155:	c7 43 14 00 00 00 00 	movl   $0x0,0x14(%ebx)
        p->name[0] = 0;
8010415c:	c6 43 6c 00          	movb   $0x0,0x6c(%ebx)
        p->killed = 0;
80104160:	c7 43 24 00 00 00 00 	movl   $0x0,0x24(%ebx)
        p->state = UNUSED;
80104167:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
        release(&ptable.lock);
8010416e:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
80104175:	e8 46 0a 00 00       	call   80104bc0 <release>
        return pid;
8010417a:	83 c4 10             	add    $0x10,%esp
}
8010417d:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104180:	89 f0                	mov    %esi,%eax
80104182:	5b                   	pop    %ebx
80104183:	5e                   	pop    %esi
80104184:	5d                   	pop    %ebp
80104185:	c3                   	ret    
      release(&ptable.lock);
80104186:	83 ec 0c             	sub    $0xc,%esp
      return -1;
80104189:	be ff ff ff ff       	mov    $0xffffffff,%esi
      release(&ptable.lock);
8010418e:	68 20 ac 11 80       	push   $0x8011ac20
80104193:	e8 28 0a 00 00       	call   80104bc0 <release>
      return -1;
80104198:	83 c4 10             	add    $0x10,%esp
8010419b:	eb e0                	jmp    8010417d <wait+0xfd>
    panic("sleep");
8010419d:	83 ec 0c             	sub    $0xc,%esp
801041a0:	68 2a 7f 10 80       	push   $0x80107f2a
801041a5:	e8 d6 c1 ff ff       	call   80100380 <panic>
801041aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801041b0 <yield>:
{
801041b0:	55                   	push   %ebp
801041b1:	89 e5                	mov    %esp,%ebp
801041b3:	53                   	push   %ebx
801041b4:	83 ec 10             	sub    $0x10,%esp
  acquire(&ptable.lock);  //DOC: yieldlock
801041b7:	68 20 ac 11 80       	push   $0x8011ac20
801041bc:	e8 df 08 00 00       	call   80104aa0 <acquire>
  pushcli();
801041c1:	e8 8a 08 00 00       	call   80104a50 <pushcli>
  c = mycpu();
801041c6:	e8 55 f7 ff ff       	call   80103920 <mycpu>
  p = c->proc;
801041cb:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
801041d1:	e8 8a 09 00 00       	call   80104b60 <popcli>
  myproc()->state = RUNNABLE;
801041d6:	c7 43 0c 03 00 00 00 	movl   $0x3,0xc(%ebx)
  sched();
801041dd:	e8 6e fc ff ff       	call   80103e50 <sched>
  release(&ptable.lock);
801041e2:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
801041e9:	e8 d2 09 00 00       	call   80104bc0 <release>
}
801041ee:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801041f1:	83 c4 10             	add    $0x10,%esp
801041f4:	c9                   	leave  
801041f5:	c3                   	ret    
801041f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801041fd:	8d 76 00             	lea    0x0(%esi),%esi

80104200 <sleep>:
{
80104200:	55                   	push   %ebp
80104201:	89 e5                	mov    %esp,%ebp
80104203:	57                   	push   %edi
80104204:	56                   	push   %esi
80104205:	53                   	push   %ebx
80104206:	83 ec 0c             	sub    $0xc,%esp
80104209:	8b 7d 08             	mov    0x8(%ebp),%edi
8010420c:	8b 75 0c             	mov    0xc(%ebp),%esi
  pushcli();
8010420f:	e8 3c 08 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80104214:	e8 07 f7 ff ff       	call   80103920 <mycpu>
  p = c->proc;
80104219:	8b 98 ac 00 00 00    	mov    0xac(%eax),%ebx
  popcli();
8010421f:	e8 3c 09 00 00       	call   80104b60 <popcli>
  if(p == 0)
80104224:	85 db                	test   %ebx,%ebx
80104226:	0f 84 87 00 00 00    	je     801042b3 <sleep+0xb3>
  if(lk == 0)
8010422c:	85 f6                	test   %esi,%esi
8010422e:	74 76                	je     801042a6 <sleep+0xa6>
  if(lk != &ptable.lock){  //DOC: sleeplock0
80104230:	81 fe 20 ac 11 80    	cmp    $0x8011ac20,%esi
80104236:	74 50                	je     80104288 <sleep+0x88>
    acquire(&ptable.lock);  //DOC: sleeplock1
80104238:	83 ec 0c             	sub    $0xc,%esp
8010423b:	68 20 ac 11 80       	push   $0x8011ac20
80104240:	e8 5b 08 00 00       	call   80104aa0 <acquire>
    release(lk);
80104245:	89 34 24             	mov    %esi,(%esp)
80104248:	e8 73 09 00 00       	call   80104bc0 <release>
  p->chan = chan;
8010424d:	89 7b 20             	mov    %edi,0x20(%ebx)
  p->state = SLEEPING;
80104250:	c7 43 0c 02 00 00 00 	movl   $0x2,0xc(%ebx)
  sched();
80104257:	e8 f4 fb ff ff       	call   80103e50 <sched>
  p->chan = 0;
8010425c:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
    release(&ptable.lock);
80104263:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
8010426a:	e8 51 09 00 00       	call   80104bc0 <release>
    acquire(lk);
8010426f:	89 75 08             	mov    %esi,0x8(%ebp)
80104272:	83 c4 10             	add    $0x10,%esp
}
80104275:	8d 65 f4             	lea    -0xc(%ebp),%esp
80104278:	5b                   	pop    %ebx
80104279:	5e                   	pop    %esi
8010427a:	5f                   	pop    %edi
8010427b:	5d                   	pop    %ebp
    acquire(lk);
8010427c:	e9 1f 08 00 00       	jmp    80104aa0 <acquire>
80104281:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  p->chan = chan;
80104288:	89 7b 20             	mov    %edi,0x20(%ebx)
  p->state = SLEEPING;
8010428b:	c7 43 0c 02 00 00 00 	movl   $0x2,0xc(%ebx)
  sched();
80104292:	e8 b9 fb ff ff       	call   80103e50 <sched>
  p->chan = 0;
80104297:	c7 43 20 00 00 00 00 	movl   $0x0,0x20(%ebx)
}
8010429e:	8d 65 f4             	lea    -0xc(%ebp),%esp
801042a1:	5b                   	pop    %ebx
801042a2:	5e                   	pop    %esi
801042a3:	5f                   	pop    %edi
801042a4:	5d                   	pop    %ebp
801042a5:	c3                   	ret    
    panic("sleep without lk");
801042a6:	83 ec 0c             	sub    $0xc,%esp
801042a9:	68 30 7f 10 80       	push   $0x80107f30
801042ae:	e8 cd c0 ff ff       	call   80100380 <panic>
    panic("sleep");
801042b3:	83 ec 0c             	sub    $0xc,%esp
801042b6:	68 2a 7f 10 80       	push   $0x80107f2a
801042bb:	e8 c0 c0 ff ff       	call   80100380 <panic>

801042c0 <wakeup>:
}

// Wake up all processes sleeping on chan.
void
wakeup(void *chan)
{
801042c0:	55                   	push   %ebp
801042c1:	89 e5                	mov    %esp,%ebp
801042c3:	53                   	push   %ebx
801042c4:	83 ec 10             	sub    $0x10,%esp
801042c7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&ptable.lock);
801042ca:	68 20 ac 11 80       	push   $0x8011ac20
801042cf:	e8 cc 07 00 00       	call   80104aa0 <acquire>
801042d4:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801042d7:	b8 54 ac 11 80       	mov    $0x8011ac54,%eax
801042dc:	eb 0e                	jmp    801042ec <wakeup+0x2c>
801042de:	66 90                	xchg   %ax,%ax
801042e0:	05 88 00 00 00       	add    $0x88,%eax
801042e5:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
801042ea:	74 1e                	je     8010430a <wakeup+0x4a>
    if(p->state == SLEEPING && p->chan == chan)
801042ec:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
801042f0:	75 ee                	jne    801042e0 <wakeup+0x20>
801042f2:	3b 58 20             	cmp    0x20(%eax),%ebx
801042f5:	75 e9                	jne    801042e0 <wakeup+0x20>
      p->state = RUNNABLE;
801042f7:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++)
801042fe:	05 88 00 00 00       	add    $0x88,%eax
80104303:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
80104308:	75 e2                	jne    801042ec <wakeup+0x2c>
  wakeup1(chan);
  release(&ptable.lock);
8010430a:	c7 45 08 20 ac 11 80 	movl   $0x8011ac20,0x8(%ebp)
}
80104311:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104314:	c9                   	leave  
  release(&ptable.lock);
80104315:	e9 a6 08 00 00       	jmp    80104bc0 <release>
8010431a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104320 <kill>:
// Kill the process with the given pid.
// Process won't exit until it returns
// to user space (see trap in trap.c).
int
kill(int pid)
{
80104320:	55                   	push   %ebp
80104321:	89 e5                	mov    %esp,%ebp
80104323:	53                   	push   %ebx
80104324:	83 ec 10             	sub    $0x10,%esp
80104327:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct proc *p;

  acquire(&ptable.lock);
8010432a:	68 20 ac 11 80       	push   $0x8011ac20
8010432f:	e8 6c 07 00 00       	call   80104aa0 <acquire>
80104334:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
80104337:	b8 54 ac 11 80       	mov    $0x8011ac54,%eax
8010433c:	eb 0e                	jmp    8010434c <kill+0x2c>
8010433e:	66 90                	xchg   %ax,%ax
80104340:	05 88 00 00 00       	add    $0x88,%eax
80104345:	3d 54 ce 11 80       	cmp    $0x8011ce54,%eax
8010434a:	74 34                	je     80104380 <kill+0x60>
    if(p->pid == pid){
8010434c:	39 58 10             	cmp    %ebx,0x10(%eax)
8010434f:	75 ef                	jne    80104340 <kill+0x20>
      p->killed = 1;
      // Wake process from sleep if necessary.
      if(p->state == SLEEPING)
80104351:	83 78 0c 02          	cmpl   $0x2,0xc(%eax)
      p->killed = 1;
80104355:	c7 40 24 01 00 00 00 	movl   $0x1,0x24(%eax)
      if(p->state == SLEEPING)
8010435c:	75 07                	jne    80104365 <kill+0x45>
        p->state = RUNNABLE;
8010435e:	c7 40 0c 03 00 00 00 	movl   $0x3,0xc(%eax)
      release(&ptable.lock);
80104365:	83 ec 0c             	sub    $0xc,%esp
80104368:	68 20 ac 11 80       	push   $0x8011ac20
8010436d:	e8 4e 08 00 00       	call   80104bc0 <release>
      return 0;
    }
  }
  release(&ptable.lock);
  return -1;
}
80104372:	8b 5d fc             	mov    -0x4(%ebp),%ebx
      return 0;
80104375:	83 c4 10             	add    $0x10,%esp
80104378:	31 c0                	xor    %eax,%eax
}
8010437a:	c9                   	leave  
8010437b:	c3                   	ret    
8010437c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  release(&ptable.lock);
80104380:	83 ec 0c             	sub    $0xc,%esp
80104383:	68 20 ac 11 80       	push   $0x8011ac20
80104388:	e8 33 08 00 00       	call   80104bc0 <release>
}
8010438d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  return -1;
80104390:	83 c4 10             	add    $0x10,%esp
80104393:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104398:	c9                   	leave  
80104399:	c3                   	ret    
8010439a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801043a0 <seminit>:

void seminit(){
801043a0:	55                   	push   %ebp
801043a1:	89 e5                	mov    %esp,%ebp
801043a3:	53                   	push   %ebx
801043a4:	bb 74 2d 11 80       	mov    $0x80112d74,%ebx
801043a9:	83 ec 0c             	sub    $0xc,%esp
	initlock(&semtable.lock,"semtable");
801043ac:	68 41 7f 10 80       	push   $0x80107f41
801043b1:	68 40 2d 11 80       	push   $0x80112d40
801043b6:	e8 d5 05 00 00       	call   80104990 <initlock>
   for(int i=0;i<100;i++){
801043bb:	83 c4 10             	add    $0x10,%esp
801043be:	66 90                	xchg   %ax,%ax
      semtable.s[i].state=0;
	   initlock(&semtable.s[i].lock,"semlock");
801043c0:	83 ec 08             	sub    $0x8,%esp
      semtable.s[i].state=0;
801043c3:	c7 43 38 00 00 00 00 	movl   $0x0,0x38(%ebx)
	   initlock(&semtable.s[i].lock,"semlock");
801043ca:	68 4a 7f 10 80       	push   $0x80107f4a
801043cf:	53                   	push   %ebx
   for(int i=0;i<100;i++){
801043d0:	81 c3 44 01 00 00    	add    $0x144,%ebx
	   initlock(&semtable.s[i].lock,"semlock");
801043d6:	e8 b5 05 00 00       	call   80104990 <initlock>
   for(int i=0;i<100;i++){
801043db:	83 c4 10             	add    $0x10,%esp
801043de:	81 fb 04 ac 11 80    	cmp    $0x8011ac04,%ebx
801043e4:	75 da                	jne    801043c0 <seminit+0x20>
   }
}
801043e6:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801043e9:	c9                   	leave  
801043ea:	c3                   	ret    
801043eb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801043ef:	90                   	nop

801043f0 <alloc_sem>:

int alloc_sem(int v){
801043f0:	55                   	push   %ebp
801043f1:	89 e5                	mov    %esp,%ebp
801043f3:	53                   	push   %ebx
  int i=0;
801043f4:	31 db                	xor    %ebx,%ebx
int alloc_sem(int v){
801043f6:	83 ec 10             	sub    $0x10,%esp
	acquire(&semtable.lock);
801043f9:	68 40 2d 11 80       	push   $0x80112d40
801043fe:	e8 9d 06 00 00       	call   80104aa0 <acquire>
	for(;i<100;i++){
80104403:	b8 ac 2d 11 80       	mov    $0x80112dac,%eax
80104408:	83 c4 10             	add    $0x10,%esp
8010440b:	eb 10                	jmp    8010441d <alloc_sem+0x2d>
8010440d:	8d 76 00             	lea    0x0(%esi),%esi
80104410:	83 c3 01             	add    $0x1,%ebx
80104413:	05 44 01 00 00       	add    $0x144,%eax
80104418:	83 fb 64             	cmp    $0x64,%ebx
8010441b:	74 53                	je     80104470 <alloc_sem+0x80>
		if(semtable.s[i].state==0)  // 0表示有空闲信号量
8010441d:	8b 10                	mov    (%eax),%edx
8010441f:	85 d2                	test   %edx,%edx
80104421:	75 ed                	jne    80104410 <alloc_sem+0x20>
	}
	//do some  initialization task
	semtable.s[i].state=1;
	semtable.s[i].count=v;
	semtable.s[i].head=semtable.s[i].tail=0;//tail always points to an empty slot; head points to the first process, if not equal to tail
	release(&semtable.lock);
80104423:	83 ec 0c             	sub    $0xc,%esp
	semtable.s[i].state=1;
80104426:	69 c3 44 01 00 00    	imul   $0x144,%ebx,%eax
	semtable.s[i].count=v;
8010442c:	8b 55 08             	mov    0x8(%ebp),%edx
	release(&semtable.lock);
8010442f:	68 40 2d 11 80       	push   $0x80112d40
	semtable.s[i].state=1;
80104434:	c7 80 ac 2d 11 80 01 	movl   $0x1,-0x7feed254(%eax)
8010443b:	00 00 00 
	semtable.s[i].count=v;
8010443e:	89 90 a8 2d 11 80    	mov    %edx,-0x7feed258(%eax)
	semtable.s[i].head=semtable.s[i].tail=0;//tail always points to an empty slot; head points to the first process, if not equal to tail
80104444:	c7 80 b4 2e 11 80 00 	movl   $0x0,-0x7feed14c(%eax)
8010444b:	00 00 00 
8010444e:	c7 80 b0 2e 11 80 00 	movl   $0x0,-0x7feed150(%eax)
80104455:	00 00 00 
	release(&semtable.lock);
80104458:	e8 63 07 00 00       	call   80104bc0 <release>
	return i;
8010445d:	83 c4 10             	add    $0x10,%esp
}
80104460:	89 d8                	mov    %ebx,%eax
80104462:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104465:	c9                   	leave  
80104466:	c3                   	ret    
80104467:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010446e:	66 90                	xchg   %ax,%ax
	if(semtable.s[i].state>0)//fail, no available semaphore
80104470:	a1 3c ac 11 80       	mov    0x8011ac3c,%eax
80104475:	85 c0                	test   %eax,%eax
80104477:	7e aa                	jle    80104423 <alloc_sem+0x33>
		release(&semtable.lock);
80104479:	83 ec 0c             	sub    $0xc,%esp
		return -1;
8010447c:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
		release(&semtable.lock);
80104481:	68 40 2d 11 80       	push   $0x80112d40
80104486:	e8 35 07 00 00       	call   80104bc0 <release>
		return -1;
8010448b:	83 c4 10             	add    $0x10,%esp
8010448e:	eb d0                	jmp    80104460 <alloc_sem+0x70>

80104490 <wait_sem>:

int wait_sem(int i){
80104490:	55                   	push   %ebp
80104491:	89 e5                	mov    %esp,%ebp
80104493:	57                   	push   %edi
80104494:	56                   	push   %esi
80104495:	53                   	push   %ebx
80104496:	83 ec 28             	sub    $0x28,%esp
	struct semaphore *sem=&semtable.s[i];
	acquire(&semtable.lock);
80104499:	68 40 2d 11 80       	push   $0x80112d40
8010449e:	e8 fd 05 00 00       	call   80104aa0 <acquire>
	if(sem->state==0){
801044a3:	69 45 08 44 01 00 00 	imul   $0x144,0x8(%ebp),%eax
801044aa:	83 c4 10             	add    $0x10,%esp
801044ad:	8b 90 ac 2d 11 80    	mov    -0x7feed254(%eax),%edx
801044b3:	85 d2                	test   %edx,%edx
801044b5:	0f 84 0d 01 00 00    	je     801045c8 <wait_sem+0x138>
		release(&semtable.lock);
		return -1;
	}
	release(&semtable.lock);
801044bb:	83 ec 0c             	sub    $0xc,%esp
801044be:	8d b8 40 2d 11 80    	lea    -0x7feed2c0(%eax),%edi
	struct semaphore *sem=&semtable.s[i];
801044c4:	8d 98 74 2d 11 80    	lea    -0x7feed28c(%eax),%ebx
	release(&semtable.lock);
801044ca:	68 40 2d 11 80       	push   $0x80112d40
801044cf:	e8 ec 06 00 00       	call   80104bc0 <release>

	acquire(&sem->lock);
801044d4:	89 1c 24             	mov    %ebx,(%esp)
801044d7:	e8 c4 05 00 00       	call   80104aa0 <acquire>
	sem->count--;
801044dc:	8b 47 68             	mov    0x68(%edi),%eax
	if(sem->count<0){//put to waiting list
801044df:	83 c4 10             	add    $0x10,%esp
	sem->count--;
801044e2:	83 e8 01             	sub    $0x1,%eax
801044e5:	89 47 68             	mov    %eax,0x68(%edi)
	if(sem->count<0){//put to waiting list
801044e8:	85 c0                	test   %eax,%eax
801044ea:	78 1c                	js     80104508 <wait_sem+0x78>
//		cprintf("sem %d: process %d sleep\n",i,myproc()->pid);
		sched();
		//when it comes back, state mush have been changed to runnable by signal_sem
		release(&ptable.lock);
	}else{
		release(&sem->lock);
801044ec:	83 ec 0c             	sub    $0xc,%esp
801044ef:	53                   	push   %ebx
801044f0:	e8 cb 06 00 00       	call   80104bc0 <release>
801044f5:	83 c4 10             	add    $0x10,%esp
	}
	return 1;
}
801044f8:	8d 65 f4             	lea    -0xc(%ebp),%esp
	return 1;
801044fb:	b8 01 00 00 00       	mov    $0x1,%eax
}
80104500:	5b                   	pop    %ebx
80104501:	5e                   	pop    %esi
80104502:	5f                   	pop    %edi
80104503:	5d                   	pop    %ebp
80104504:	c3                   	ret    
80104505:	8d 76 00             	lea    0x0(%esi),%esi
		acquire(&ptable.lock);
80104508:	83 ec 0c             	sub    $0xc,%esp
8010450b:	68 20 ac 11 80       	push   $0x8011ac20
80104510:	e8 8b 05 00 00       	call   80104aa0 <acquire>
  pushcli();
80104515:	e8 36 05 00 00       	call   80104a50 <pushcli>
  c = mycpu();
8010451a:	e8 01 f4 ff ff       	call   80103920 <mycpu>
  p = c->proc;
8010451f:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80104525:	e8 36 06 00 00       	call   80104b60 <popcli>
		myproc()->state=SLEEPING;
8010452a:	c7 46 0c 02 00 00 00 	movl   $0x2,0xc(%esi)
  pushcli();
80104531:	e8 1a 05 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80104536:	e8 e5 f3 ff ff       	call   80103920 <mycpu>
  p = c->proc;
8010453b:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80104541:	e8 1a 06 00 00       	call   80104b60 <popcli>
		myproc()->chan=sem;
80104546:	89 5e 20             	mov    %ebx,0x20(%esi)
		sem->waiting_list[sem->tail]=myproc();
80104549:	8b 97 74 01 00 00    	mov    0x174(%edi),%edx
8010454f:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  pushcli();
80104552:	e8 f9 04 00 00       	call   80104a50 <pushcli>
  c = mycpu();
80104557:	e8 c4 f3 ff ff       	call   80103920 <mycpu>
  p = c->proc;
8010455c:	8b b0 ac 00 00 00    	mov    0xac(%eax),%esi
  popcli();
80104562:	e8 f9 05 00 00       	call   80104b60 <popcli>
		sem->waiting_list[sem->tail]=myproc();
80104567:	8b 45 08             	mov    0x8(%ebp),%eax
8010456a:	8b 55 e4             	mov    -0x1c(%ebp),%edx
		release(&sem->lock);
8010456d:	89 1c 24             	mov    %ebx,(%esp)
		sem->waiting_list[sem->tail]=myproc();
80104570:	8d 04 c0             	lea    (%eax,%eax,8),%eax
80104573:	8d 04 c0             	lea    (%eax,%eax,8),%eax
80104576:	8d 44 02 18          	lea    0x18(%edx,%eax,1),%eax
8010457a:	89 34 85 50 2d 11 80 	mov    %esi,-0x7feed2b0(,%eax,4)
		sem->tail=(sem->tail+1)%NPROC;
80104581:	8b 87 74 01 00 00    	mov    0x174(%edi),%eax
80104587:	83 c0 01             	add    $0x1,%eax
8010458a:	99                   	cltd   
8010458b:	c1 ea 1a             	shr    $0x1a,%edx
8010458e:	01 d0                	add    %edx,%eax
80104590:	83 e0 3f             	and    $0x3f,%eax
80104593:	29 d0                	sub    %edx,%eax
80104595:	89 87 74 01 00 00    	mov    %eax,0x174(%edi)
		release(&sem->lock);
8010459b:	e8 20 06 00 00       	call   80104bc0 <release>
		sched();
801045a0:	e8 ab f8 ff ff       	call   80103e50 <sched>
		release(&ptable.lock);
801045a5:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
801045ac:	e8 0f 06 00 00       	call   80104bc0 <release>
801045b1:	83 c4 10             	add    $0x10,%esp
}
801045b4:	8d 65 f4             	lea    -0xc(%ebp),%esp
	return 1;
801045b7:	b8 01 00 00 00       	mov    $0x1,%eax
}
801045bc:	5b                   	pop    %ebx
801045bd:	5e                   	pop    %esi
801045be:	5f                   	pop    %edi
801045bf:	5d                   	pop    %ebp
801045c0:	c3                   	ret    
801045c1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
		release(&semtable.lock);
801045c8:	83 ec 0c             	sub    $0xc,%esp
801045cb:	68 40 2d 11 80       	push   $0x80112d40
801045d0:	e8 eb 05 00 00       	call   80104bc0 <release>
		return -1;
801045d5:	83 c4 10             	add    $0x10,%esp
}
801045d8:	8d 65 f4             	lea    -0xc(%ebp),%esp
		return -1;
801045db:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801045e0:	5b                   	pop    %ebx
801045e1:	5e                   	pop    %esi
801045e2:	5f                   	pop    %edi
801045e3:	5d                   	pop    %ebp
801045e4:	c3                   	ret    
801045e5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801045ec:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801045f0 <signal_sem>:

int signal_sem(int i)
{
801045f0:	55                   	push   %ebp
801045f1:	89 e5                	mov    %esp,%ebp
801045f3:	57                   	push   %edi
801045f4:	56                   	push   %esi
801045f5:	53                   	push   %ebx
801045f6:	83 ec 18             	sub    $0x18,%esp
801045f9:	8b 75 08             	mov    0x8(%ebp),%esi
//	cprintf("signal sem %d\n",i);
	struct semaphore *sem=&semtable.s[i];
	acquire(&semtable.lock);
801045fc:	68 40 2d 11 80       	push   $0x80112d40
	if(sem->state==0){
80104601:	69 de 44 01 00 00    	imul   $0x144,%esi,%ebx
	acquire(&semtable.lock);
80104607:	e8 94 04 00 00       	call   80104aa0 <acquire>
	if(sem->state==0){
8010460c:	83 c4 10             	add    $0x10,%esp
8010460f:	8b 83 ac 2d 11 80    	mov    -0x7feed254(%ebx),%eax
80104615:	85 c0                	test   %eax,%eax
80104617:	74 4f                	je     80104668 <signal_sem+0x78>
		release(&semtable.lock);
		return -1;
	}
	release(&semtable.lock);
80104619:	83 ec 0c             	sub    $0xc,%esp
8010461c:	8d bb 40 2d 11 80    	lea    -0x7feed2c0(%ebx),%edi
	acquire(&sem->lock);
80104622:	81 c3 74 2d 11 80    	add    $0x80112d74,%ebx
	release(&semtable.lock);
80104628:	68 40 2d 11 80       	push   $0x80112d40
8010462d:	e8 8e 05 00 00       	call   80104bc0 <release>
	acquire(&sem->lock);
80104632:	89 1c 24             	mov    %ebx,(%esp)
80104635:	e8 66 04 00 00       	call   80104aa0 <acquire>
	sem->count++;
8010463a:	8b 47 68             	mov    0x68(%edi),%eax
	if(sem->count<=0){//wakeup the first process
8010463d:	83 c4 10             	add    $0x10,%esp
	sem->count++;
80104640:	83 c0 01             	add    $0x1,%eax
80104643:	89 47 68             	mov    %eax,0x68(%edi)
	if(sem->count<=0){//wakeup the first process
80104646:	85 c0                	test   %eax,%eax
80104648:	7e 3e                	jle    80104688 <signal_sem+0x98>
		acquire(&ptable.lock);
		p->state=RUNNABLE;
//		cprintf("wake up process %d\n",p->pid);
		release(&ptable.lock);
	}
	release(&sem->lock);
8010464a:	83 ec 0c             	sub    $0xc,%esp
8010464d:	53                   	push   %ebx
8010464e:	e8 6d 05 00 00       	call   80104bc0 <release>
	return 1;
80104653:	83 c4 10             	add    $0x10,%esp
}
80104656:	8d 65 f4             	lea    -0xc(%ebp),%esp
	return 1;
80104659:	b8 01 00 00 00       	mov    $0x1,%eax
}
8010465e:	5b                   	pop    %ebx
8010465f:	5e                   	pop    %esi
80104660:	5f                   	pop    %edi
80104661:	5d                   	pop    %ebp
80104662:	c3                   	ret    
80104663:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104667:	90                   	nop
		release(&semtable.lock);
80104668:	83 ec 0c             	sub    $0xc,%esp
8010466b:	68 40 2d 11 80       	push   $0x80112d40
80104670:	e8 4b 05 00 00       	call   80104bc0 <release>
		return -1;
80104675:	83 c4 10             	add    $0x10,%esp
}
80104678:	8d 65 f4             	lea    -0xc(%ebp),%esp
		return -1;
8010467b:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104680:	5b                   	pop    %ebx
80104681:	5e                   	pop    %esi
80104682:	5f                   	pop    %edi
80104683:	5d                   	pop    %ebp
80104684:	c3                   	ret    
80104685:	8d 76 00             	lea    0x0(%esi),%esi
		struct proc *p=sem->waiting_list[sem->head];
80104688:	8b 87 70 01 00 00    	mov    0x170(%edi),%eax
8010468e:	8d 14 f6             	lea    (%esi,%esi,8),%edx
		acquire(&ptable.lock);
80104691:	83 ec 0c             	sub    $0xc,%esp
		struct proc *p=sem->waiting_list[sem->head];
80104694:	8d 14 d2             	lea    (%edx,%edx,8),%edx
		acquire(&ptable.lock);
80104697:	68 20 ac 11 80       	push   $0x8011ac20
		struct proc *p=sem->waiting_list[sem->head];
8010469c:	8d 54 10 18          	lea    0x18(%eax,%edx,1),%edx
		sem->head=(sem->head+1)%NPROC;
801046a0:	83 c0 01             	add    $0x1,%eax
		struct proc *p=sem->waiting_list[sem->head];
801046a3:	8b 34 95 50 2d 11 80 	mov    -0x7feed2b0(,%edx,4),%esi
		sem->head=(sem->head+1)%NPROC;
801046aa:	99                   	cltd   
801046ab:	c1 ea 1a             	shr    $0x1a,%edx
801046ae:	01 d0                	add    %edx,%eax
801046b0:	83 e0 3f             	and    $0x3f,%eax
801046b3:	29 d0                	sub    %edx,%eax
801046b5:	89 87 70 01 00 00    	mov    %eax,0x170(%edi)
		acquire(&ptable.lock);
801046bb:	e8 e0 03 00 00       	call   80104aa0 <acquire>
		p->state=RUNNABLE;
801046c0:	c7 46 0c 03 00 00 00 	movl   $0x3,0xc(%esi)
		release(&ptable.lock);
801046c7:	c7 04 24 20 ac 11 80 	movl   $0x8011ac20,(%esp)
801046ce:	e8 ed 04 00 00       	call   80104bc0 <release>
801046d3:	83 c4 10             	add    $0x10,%esp
801046d6:	e9 6f ff ff ff       	jmp    8010464a <signal_sem+0x5a>
801046db:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801046df:	90                   	nop

801046e0 <dealloc_sem>:

int dealloc_sem(int i){
801046e0:	55                   	push   %ebp
801046e1:	89 e5                	mov    %esp,%ebp
801046e3:	56                   	push   %esi
801046e4:	53                   	push   %ebx
801046e5:	8b 75 08             	mov    0x8(%ebp),%esi
	struct semaphore *sem=&semtable.s[i];
	acquire(&semtable.lock);
	if(sem->state==0){
801046e8:	69 de 44 01 00 00    	imul   $0x144,%esi,%ebx
	acquire(&semtable.lock);
801046ee:	83 ec 0c             	sub    $0xc,%esp
801046f1:	68 40 2d 11 80       	push   $0x80112d40
801046f6:	e8 a5 03 00 00       	call   80104aa0 <acquire>
	if(sem->state==0){
801046fb:	8b 83 ac 2d 11 80    	mov    -0x7feed254(%ebx),%eax
80104701:	83 c4 10             	add    $0x10,%esp
80104704:	85 c0                	test   %eax,%eax
80104706:	0f 84 8b 00 00 00    	je     80104797 <dealloc_sem+0xb7>
		release(&semtable.lock);
		return -1;
	}
	
	acquire(&ptable.lock);
8010470c:	83 ec 0c             	sub    $0xc,%esp
	struct semaphore *sem=&semtable.s[i];
8010470f:	81 c3 74 2d 11 80    	add    $0x80112d74,%ebx
	acquire(&ptable.lock);
80104715:	68 20 ac 11 80       	push   $0x8011ac20
8010471a:	e8 81 03 00 00       	call   80104aa0 <acquire>
	for(int i=0;i<NPROC;i++){
8010471f:	b8 60 ac 11 80       	mov    $0x8011ac60,%eax
80104724:	83 c4 10             	add    $0x10,%esp
80104727:	eb 13                	jmp    8010473c <dealloc_sem+0x5c>
80104729:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104730:	05 88 00 00 00       	add    $0x88,%eax
80104735:	3d 60 ce 11 80       	cmp    $0x8011ce60,%eax
8010473a:	74 23                	je     8010475f <dealloc_sem+0x7f>
		if(ptable.proc[i].state==SLEEPING&&ptable.proc[i].chan==sem){
8010473c:	83 38 02             	cmpl   $0x2,(%eax)
8010473f:	75 ef                	jne    80104730 <dealloc_sem+0x50>
80104741:	39 58 14             	cmp    %ebx,0x14(%eax)
80104744:	75 ea                	jne    80104730 <dealloc_sem+0x50>
			//wake it up and kill it
			ptable.proc[i].state=RUNNABLE;
80104746:	c7 00 03 00 00 00    	movl   $0x3,(%eax)
	for(int i=0;i<NPROC;i++){
8010474c:	05 88 00 00 00       	add    $0x88,%eax
			ptable.proc[i].killed=1;
80104751:	c7 40 90 01 00 00 00 	movl   $0x1,-0x70(%eax)
	for(int i=0;i<NPROC;i++){
80104758:	3d 60 ce 11 80       	cmp    $0x8011ce60,%eax
8010475d:	75 dd                	jne    8010473c <dealloc_sem+0x5c>
		}
	}
	release(&ptable.lock);
8010475f:	83 ec 0c             	sub    $0xc,%esp
	sem->state=0;
80104762:	69 f6 44 01 00 00    	imul   $0x144,%esi,%esi
	release(&ptable.lock);
80104768:	68 20 ac 11 80       	push   $0x8011ac20
8010476d:	e8 4e 04 00 00       	call   80104bc0 <release>
	release(&semtable.lock);
80104772:	c7 04 24 40 2d 11 80 	movl   $0x80112d40,(%esp)
	sem->state=0;
80104779:	c7 86 ac 2d 11 80 00 	movl   $0x0,-0x7feed254(%esi)
80104780:	00 00 00 
	release(&semtable.lock);
80104783:	e8 38 04 00 00       	call   80104bc0 <release>
	return 1;
80104788:	83 c4 10             	add    $0x10,%esp
}
8010478b:	8d 65 f8             	lea    -0x8(%ebp),%esp
	return 1;
8010478e:	b8 01 00 00 00       	mov    $0x1,%eax
}
80104793:	5b                   	pop    %ebx
80104794:	5e                   	pop    %esi
80104795:	5d                   	pop    %ebp
80104796:	c3                   	ret    
		release(&semtable.lock);
80104797:	83 ec 0c             	sub    $0xc,%esp
8010479a:	68 40 2d 11 80       	push   $0x80112d40
8010479f:	e8 1c 04 00 00       	call   80104bc0 <release>
		return -1;
801047a4:	83 c4 10             	add    $0x10,%esp
}
801047a7:	8d 65 f8             	lea    -0x8(%ebp),%esp
		return -1;
801047aa:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801047af:	5b                   	pop    %ebx
801047b0:	5e                   	pop    %esi
801047b1:	5d                   	pop    %ebp
801047b2:	c3                   	ret    
801047b3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801047ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801047c0 <procdump>:
// Print a process listing to console.  For debugging.
// Runs when user types ^P on console.
// No lock to avoid wedging a stuck machine further.
void
procdump(void)
{
801047c0:	55                   	push   %ebp
801047c1:	89 e5                	mov    %esp,%ebp
801047c3:	57                   	push   %edi
801047c4:	56                   	push   %esi
801047c5:	8d 75 e8             	lea    -0x18(%ebp),%esi
801047c8:	53                   	push   %ebx
801047c9:	bb c0 ac 11 80       	mov    $0x8011acc0,%ebx
801047ce:	83 ec 3c             	sub    $0x3c,%esp
801047d1:	eb 27                	jmp    801047fa <procdump+0x3a>
801047d3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801047d7:	90                   	nop
    if(p->state == SLEEPING){
      getcallerpcs((uint*)p->context->ebp+2, pc);
      for(i=0; i<10 && pc[i] != 0; i++)
        cprintf(" %p", pc[i]);
    }
    cprintf("\n");
801047d8:	83 ec 0c             	sub    $0xc,%esp
801047db:	68 f7 82 10 80       	push   $0x801082f7
801047e0:	e8 bb be ff ff       	call   801006a0 <cprintf>
801047e5:	83 c4 10             	add    $0x10,%esp
  for(p = ptable.proc; p < &ptable.proc[NPROC]; p++){
801047e8:	81 c3 88 00 00 00    	add    $0x88,%ebx
801047ee:	81 fb c0 ce 11 80    	cmp    $0x8011cec0,%ebx
801047f4:	0f 84 7e 00 00 00    	je     80104878 <procdump+0xb8>
    if(p->state == UNUSED)
801047fa:	8b 43 a0             	mov    -0x60(%ebx),%eax
801047fd:	85 c0                	test   %eax,%eax
801047ff:	74 e7                	je     801047e8 <procdump+0x28>
      state = "???";
80104801:	ba 52 7f 10 80       	mov    $0x80107f52,%edx
    if(p->state >= 0 && p->state < NELEM(states) && states[p->state])
80104806:	83 f8 05             	cmp    $0x5,%eax
80104809:	77 11                	ja     8010481c <procdump+0x5c>
8010480b:	8b 14 85 b4 7f 10 80 	mov    -0x7fef804c(,%eax,4),%edx
      state = "???";
80104812:	b8 52 7f 10 80       	mov    $0x80107f52,%eax
80104817:	85 d2                	test   %edx,%edx
80104819:	0f 44 d0             	cmove  %eax,%edx
    cprintf("%d %s %s", p->pid, state, p->name);
8010481c:	53                   	push   %ebx
8010481d:	52                   	push   %edx
8010481e:	ff 73 a4             	push   -0x5c(%ebx)
80104821:	68 56 7f 10 80       	push   $0x80107f56
80104826:	e8 75 be ff ff       	call   801006a0 <cprintf>
    if(p->state == SLEEPING){
8010482b:	83 c4 10             	add    $0x10,%esp
8010482e:	83 7b a0 02          	cmpl   $0x2,-0x60(%ebx)
80104832:	75 a4                	jne    801047d8 <procdump+0x18>
      getcallerpcs((uint*)p->context->ebp+2, pc);
80104834:	83 ec 08             	sub    $0x8,%esp
80104837:	8d 45 c0             	lea    -0x40(%ebp),%eax
8010483a:	8d 7d c0             	lea    -0x40(%ebp),%edi
8010483d:	50                   	push   %eax
8010483e:	8b 43 b0             	mov    -0x50(%ebx),%eax
80104841:	8b 40 0c             	mov    0xc(%eax),%eax
80104844:	83 c0 08             	add    $0x8,%eax
80104847:	50                   	push   %eax
80104848:	e8 63 01 00 00       	call   801049b0 <getcallerpcs>
      for(i=0; i<10 && pc[i] != 0; i++)
8010484d:	83 c4 10             	add    $0x10,%esp
80104850:	8b 17                	mov    (%edi),%edx
80104852:	85 d2                	test   %edx,%edx
80104854:	74 82                	je     801047d8 <procdump+0x18>
        cprintf(" %p", pc[i]);
80104856:	83 ec 08             	sub    $0x8,%esp
      for(i=0; i<10 && pc[i] != 0; i++)
80104859:	83 c7 04             	add    $0x4,%edi
        cprintf(" %p", pc[i]);
8010485c:	52                   	push   %edx
8010485d:	68 81 79 10 80       	push   $0x80107981
80104862:	e8 39 be ff ff       	call   801006a0 <cprintf>
      for(i=0; i<10 && pc[i] != 0; i++)
80104867:	83 c4 10             	add    $0x10,%esp
8010486a:	39 fe                	cmp    %edi,%esi
8010486c:	75 e2                	jne    80104850 <procdump+0x90>
8010486e:	e9 65 ff ff ff       	jmp    801047d8 <procdump+0x18>
80104873:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104877:	90                   	nop
  }
}
80104878:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010487b:	5b                   	pop    %ebx
8010487c:	5e                   	pop    %esi
8010487d:	5f                   	pop    %edi
8010487e:	5d                   	pop    %ebp
8010487f:	c3                   	ret    

80104880 <initsleeplock>:
#include "spinlock.h"
#include "sleeplock.h"

void
initsleeplock(struct sleeplock *lk, char *name)
{
80104880:	55                   	push   %ebp
80104881:	89 e5                	mov    %esp,%ebp
80104883:	53                   	push   %ebx
80104884:	83 ec 0c             	sub    $0xc,%esp
80104887:	8b 5d 08             	mov    0x8(%ebp),%ebx
  initlock(&lk->lk, "sleep lock");
8010488a:	68 cc 7f 10 80       	push   $0x80107fcc
8010488f:	8d 43 04             	lea    0x4(%ebx),%eax
80104892:	50                   	push   %eax
80104893:	e8 f8 00 00 00       	call   80104990 <initlock>
  lk->name = name;
80104898:	8b 45 0c             	mov    0xc(%ebp),%eax
  lk->locked = 0;
8010489b:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  lk->pid = 0;
}
801048a1:	83 c4 10             	add    $0x10,%esp
  lk->pid = 0;
801048a4:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)
  lk->name = name;
801048ab:	89 43 38             	mov    %eax,0x38(%ebx)
}
801048ae:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801048b1:	c9                   	leave  
801048b2:	c3                   	ret    
801048b3:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801048ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801048c0 <acquiresleep>:

void
acquiresleep(struct sleeplock *lk)
{
801048c0:	55                   	push   %ebp
801048c1:	89 e5                	mov    %esp,%ebp
801048c3:	56                   	push   %esi
801048c4:	53                   	push   %ebx
801048c5:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&lk->lk);
801048c8:	8d 73 04             	lea    0x4(%ebx),%esi
801048cb:	83 ec 0c             	sub    $0xc,%esp
801048ce:	56                   	push   %esi
801048cf:	e8 cc 01 00 00       	call   80104aa0 <acquire>
  while (lk->locked) {
801048d4:	8b 13                	mov    (%ebx),%edx
801048d6:	83 c4 10             	add    $0x10,%esp
801048d9:	85 d2                	test   %edx,%edx
801048db:	74 16                	je     801048f3 <acquiresleep+0x33>
801048dd:	8d 76 00             	lea    0x0(%esi),%esi
    sleep(lk, &lk->lk);
801048e0:	83 ec 08             	sub    $0x8,%esp
801048e3:	56                   	push   %esi
801048e4:	53                   	push   %ebx
801048e5:	e8 16 f9 ff ff       	call   80104200 <sleep>
  while (lk->locked) {
801048ea:	8b 03                	mov    (%ebx),%eax
801048ec:	83 c4 10             	add    $0x10,%esp
801048ef:	85 c0                	test   %eax,%eax
801048f1:	75 ed                	jne    801048e0 <acquiresleep+0x20>
  }
  lk->locked = 1;
801048f3:	c7 03 01 00 00 00    	movl   $0x1,(%ebx)
  lk->pid = myproc()->pid;
801048f9:	e8 a2 f0 ff ff       	call   801039a0 <myproc>
801048fe:	8b 40 10             	mov    0x10(%eax),%eax
80104901:	89 43 3c             	mov    %eax,0x3c(%ebx)
  release(&lk->lk);
80104904:	89 75 08             	mov    %esi,0x8(%ebp)
}
80104907:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010490a:	5b                   	pop    %ebx
8010490b:	5e                   	pop    %esi
8010490c:	5d                   	pop    %ebp
  release(&lk->lk);
8010490d:	e9 ae 02 00 00       	jmp    80104bc0 <release>
80104912:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104919:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104920 <releasesleep>:

void
releasesleep(struct sleeplock *lk)
{
80104920:	55                   	push   %ebp
80104921:	89 e5                	mov    %esp,%ebp
80104923:	56                   	push   %esi
80104924:	53                   	push   %ebx
80104925:	8b 5d 08             	mov    0x8(%ebp),%ebx
  acquire(&lk->lk);
80104928:	8d 73 04             	lea    0x4(%ebx),%esi
8010492b:	83 ec 0c             	sub    $0xc,%esp
8010492e:	56                   	push   %esi
8010492f:	e8 6c 01 00 00       	call   80104aa0 <acquire>
  lk->locked = 0;
80104934:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  lk->pid = 0;
8010493a:	c7 43 3c 00 00 00 00 	movl   $0x0,0x3c(%ebx)
  wakeup(lk);
80104941:	89 1c 24             	mov    %ebx,(%esp)
80104944:	e8 77 f9 ff ff       	call   801042c0 <wakeup>
  release(&lk->lk);
80104949:	89 75 08             	mov    %esi,0x8(%ebp)
8010494c:	83 c4 10             	add    $0x10,%esp
}
8010494f:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104952:	5b                   	pop    %ebx
80104953:	5e                   	pop    %esi
80104954:	5d                   	pop    %ebp
  release(&lk->lk);
80104955:	e9 66 02 00 00       	jmp    80104bc0 <release>
8010495a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104960 <holdingsleep>:

int
holdingsleep(struct sleeplock *lk)
{
80104960:	55                   	push   %ebp
80104961:	89 e5                	mov    %esp,%ebp
80104963:	56                   	push   %esi
80104964:	53                   	push   %ebx
80104965:	8b 75 08             	mov    0x8(%ebp),%esi
  int r;
  
  acquire(&lk->lk);
80104968:	8d 5e 04             	lea    0x4(%esi),%ebx
8010496b:	83 ec 0c             	sub    $0xc,%esp
8010496e:	53                   	push   %ebx
8010496f:	e8 2c 01 00 00       	call   80104aa0 <acquire>
  r = lk->locked;
80104974:	8b 36                	mov    (%esi),%esi
  release(&lk->lk);
80104976:	89 1c 24             	mov    %ebx,(%esp)
80104979:	e8 42 02 00 00       	call   80104bc0 <release>
  return r;
}
8010497e:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104981:	89 f0                	mov    %esi,%eax
80104983:	5b                   	pop    %ebx
80104984:	5e                   	pop    %esi
80104985:	5d                   	pop    %ebp
80104986:	c3                   	ret    
80104987:	66 90                	xchg   %ax,%ax
80104989:	66 90                	xchg   %ax,%ax
8010498b:	66 90                	xchg   %ax,%ax
8010498d:	66 90                	xchg   %ax,%ax
8010498f:	90                   	nop

80104990 <initlock>:
#include "proc.h"
#include "spinlock.h"

void
initlock(struct spinlock *lk, char *name)
{
80104990:	55                   	push   %ebp
80104991:	89 e5                	mov    %esp,%ebp
80104993:	8b 45 08             	mov    0x8(%ebp),%eax
  lk->name = name;
80104996:	8b 55 0c             	mov    0xc(%ebp),%edx
  lk->locked = 0;
80104999:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  lk->name = name;
8010499f:	89 50 04             	mov    %edx,0x4(%eax)
  lk->cpu = 0;
801049a2:	c7 40 08 00 00 00 00 	movl   $0x0,0x8(%eax)
}
801049a9:	5d                   	pop    %ebp
801049aa:	c3                   	ret    
801049ab:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801049af:	90                   	nop

801049b0 <getcallerpcs>:
}

// Record the current call stack in pcs[] by following the %ebp chain.
void
getcallerpcs(void *v, uint pcs[])
{
801049b0:	55                   	push   %ebp
  uint *ebp;
  int i;

  ebp = (uint*)v - 2;
  for(i = 0; i < 10; i++){
801049b1:	31 d2                	xor    %edx,%edx
{
801049b3:	89 e5                	mov    %esp,%ebp
801049b5:	53                   	push   %ebx
  ebp = (uint*)v - 2;
801049b6:	8b 45 08             	mov    0x8(%ebp),%eax
{
801049b9:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  ebp = (uint*)v - 2;
801049bc:	83 e8 08             	sub    $0x8,%eax
  for(i = 0; i < 10; i++){
801049bf:	90                   	nop
    if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
801049c0:	8d 98 00 00 00 80    	lea    -0x80000000(%eax),%ebx
801049c6:	81 fb fe ff ff 7f    	cmp    $0x7ffffffe,%ebx
801049cc:	77 1a                	ja     801049e8 <getcallerpcs+0x38>
      break;
    pcs[i] = ebp[1];     // saved %eip
801049ce:	8b 58 04             	mov    0x4(%eax),%ebx
801049d1:	89 1c 91             	mov    %ebx,(%ecx,%edx,4)
  for(i = 0; i < 10; i++){
801049d4:	83 c2 01             	add    $0x1,%edx
    ebp = (uint*)ebp[0]; // saved %ebp
801049d7:	8b 00                	mov    (%eax),%eax
  for(i = 0; i < 10; i++){
801049d9:	83 fa 0a             	cmp    $0xa,%edx
801049dc:	75 e2                	jne    801049c0 <getcallerpcs+0x10>
  }
  for(; i < 10; i++)
    pcs[i] = 0;
}
801049de:	8b 5d fc             	mov    -0x4(%ebp),%ebx
801049e1:	c9                   	leave  
801049e2:	c3                   	ret    
801049e3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801049e7:	90                   	nop
  for(; i < 10; i++)
801049e8:	8d 04 91             	lea    (%ecx,%edx,4),%eax
801049eb:	8d 51 28             	lea    0x28(%ecx),%edx
801049ee:	66 90                	xchg   %ax,%ax
    pcs[i] = 0;
801049f0:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  for(; i < 10; i++)
801049f6:	83 c0 04             	add    $0x4,%eax
801049f9:	39 d0                	cmp    %edx,%eax
801049fb:	75 f3                	jne    801049f0 <getcallerpcs+0x40>
}
801049fd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104a00:	c9                   	leave  
80104a01:	c3                   	ret    
80104a02:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104a09:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104a10 <holding>:

// Check whether this cpu is holding the lock.
int
holding(struct spinlock *lock)
{
80104a10:	55                   	push   %ebp
80104a11:	89 e5                	mov    %esp,%ebp
80104a13:	53                   	push   %ebx
80104a14:	83 ec 04             	sub    $0x4,%esp
80104a17:	8b 55 08             	mov    0x8(%ebp),%edx
  return lock->locked && lock->cpu == mycpu();
80104a1a:	8b 02                	mov    (%edx),%eax
80104a1c:	85 c0                	test   %eax,%eax
80104a1e:	75 10                	jne    80104a30 <holding+0x20>
}
80104a20:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104a23:	31 c0                	xor    %eax,%eax
80104a25:	c9                   	leave  
80104a26:	c3                   	ret    
80104a27:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104a2e:	66 90                	xchg   %ax,%ax
80104a30:	8b 5a 08             	mov    0x8(%edx),%ebx
  return lock->locked && lock->cpu == mycpu();
80104a33:	e8 e8 ee ff ff       	call   80103920 <mycpu>
80104a38:	39 c3                	cmp    %eax,%ebx
}
80104a3a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104a3d:	c9                   	leave  
  return lock->locked && lock->cpu == mycpu();
80104a3e:	0f 94 c0             	sete   %al
80104a41:	0f b6 c0             	movzbl %al,%eax
}
80104a44:	c3                   	ret    
80104a45:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104a4c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80104a50 <pushcli>:
// it takes two popcli to undo two pushcli.  Also, if interrupts
// are off, then pushcli, popcli leaves them off.

void
pushcli(void)
{
80104a50:	55                   	push   %ebp
80104a51:	89 e5                	mov    %esp,%ebp
80104a53:	53                   	push   %ebx
80104a54:	83 ec 04             	sub    $0x4,%esp
80104a57:	9c                   	pushf  
80104a58:	5b                   	pop    %ebx
  asm volatile("cli");
80104a59:	fa                   	cli    
  int eflags;

  eflags = readeflags();
  cli();
  if(mycpu()->ncli == 0)
80104a5a:	e8 c1 ee ff ff       	call   80103920 <mycpu>
80104a5f:	8b 80 a4 00 00 00    	mov    0xa4(%eax),%eax
80104a65:	85 c0                	test   %eax,%eax
80104a67:	74 17                	je     80104a80 <pushcli+0x30>
    mycpu()->intena = eflags & FL_IF;
  mycpu()->ncli += 1;
80104a69:	e8 b2 ee ff ff       	call   80103920 <mycpu>
80104a6e:	83 80 a4 00 00 00 01 	addl   $0x1,0xa4(%eax)
}
80104a75:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104a78:	c9                   	leave  
80104a79:	c3                   	ret    
80104a7a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    mycpu()->intena = eflags & FL_IF;
80104a80:	e8 9b ee ff ff       	call   80103920 <mycpu>
80104a85:	81 e3 00 02 00 00    	and    $0x200,%ebx
80104a8b:	89 98 a8 00 00 00    	mov    %ebx,0xa8(%eax)
80104a91:	eb d6                	jmp    80104a69 <pushcli+0x19>
80104a93:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104a9a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104aa0 <acquire>:
{
80104aa0:	55                   	push   %ebp
80104aa1:	89 e5                	mov    %esp,%ebp
80104aa3:	53                   	push   %ebx
80104aa4:	83 ec 04             	sub    $0x4,%esp
  pushcli(); // disable interrupts to avoid deadlock.
80104aa7:	e8 a4 ff ff ff       	call   80104a50 <pushcli>
  if(holding(lk))
80104aac:	8b 55 08             	mov    0x8(%ebp),%edx
  return lock->locked && lock->cpu == mycpu();
80104aaf:	8b 02                	mov    (%edx),%eax
80104ab1:	85 c0                	test   %eax,%eax
80104ab3:	0f 85 7f 00 00 00    	jne    80104b38 <acquire+0x98>
  asm volatile("lock; xchgl %0, %1" :
80104ab9:	b9 01 00 00 00       	mov    $0x1,%ecx
80104abe:	eb 03                	jmp    80104ac3 <acquire+0x23>
  while(xchg(&lk->locked, 1) != 0)
80104ac0:	8b 55 08             	mov    0x8(%ebp),%edx
80104ac3:	89 c8                	mov    %ecx,%eax
80104ac5:	f0 87 02             	lock xchg %eax,(%edx)
80104ac8:	85 c0                	test   %eax,%eax
80104aca:	75 f4                	jne    80104ac0 <acquire+0x20>
  __sync_synchronize();
80104acc:	f0 83 0c 24 00       	lock orl $0x0,(%esp)
  lk->cpu = mycpu();
80104ad1:	8b 5d 08             	mov    0x8(%ebp),%ebx
80104ad4:	e8 47 ee ff ff       	call   80103920 <mycpu>
  getcallerpcs(&lk, lk->pcs);
80104ad9:	8b 4d 08             	mov    0x8(%ebp),%ecx
  ebp = (uint*)v - 2;
80104adc:	89 ea                	mov    %ebp,%edx
  lk->cpu = mycpu();
80104ade:	89 43 08             	mov    %eax,0x8(%ebx)
  for(i = 0; i < 10; i++){
80104ae1:	31 c0                	xor    %eax,%eax
80104ae3:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104ae7:	90                   	nop
    if(ebp == 0 || ebp < (uint*)KERNBASE || ebp == (uint*)0xffffffff)
80104ae8:	8d 9a 00 00 00 80    	lea    -0x80000000(%edx),%ebx
80104aee:	81 fb fe ff ff 7f    	cmp    $0x7ffffffe,%ebx
80104af4:	77 1a                	ja     80104b10 <acquire+0x70>
    pcs[i] = ebp[1];     // saved %eip
80104af6:	8b 5a 04             	mov    0x4(%edx),%ebx
80104af9:	89 5c 81 0c          	mov    %ebx,0xc(%ecx,%eax,4)
  for(i = 0; i < 10; i++){
80104afd:	83 c0 01             	add    $0x1,%eax
    ebp = (uint*)ebp[0]; // saved %ebp
80104b00:	8b 12                	mov    (%edx),%edx
  for(i = 0; i < 10; i++){
80104b02:	83 f8 0a             	cmp    $0xa,%eax
80104b05:	75 e1                	jne    80104ae8 <acquire+0x48>
}
80104b07:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104b0a:	c9                   	leave  
80104b0b:	c3                   	ret    
80104b0c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  for(; i < 10; i++)
80104b10:	8d 44 81 0c          	lea    0xc(%ecx,%eax,4),%eax
80104b14:	8d 51 34             	lea    0x34(%ecx),%edx
80104b17:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104b1e:	66 90                	xchg   %ax,%ax
    pcs[i] = 0;
80104b20:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
  for(; i < 10; i++)
80104b26:	83 c0 04             	add    $0x4,%eax
80104b29:	39 c2                	cmp    %eax,%edx
80104b2b:	75 f3                	jne    80104b20 <acquire+0x80>
}
80104b2d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104b30:	c9                   	leave  
80104b31:	c3                   	ret    
80104b32:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80104b38:	8b 5a 08             	mov    0x8(%edx),%ebx
  return lock->locked && lock->cpu == mycpu();
80104b3b:	e8 e0 ed ff ff       	call   80103920 <mycpu>
80104b40:	39 c3                	cmp    %eax,%ebx
80104b42:	74 0c                	je     80104b50 <acquire+0xb0>
  while(xchg(&lk->locked, 1) != 0)
80104b44:	8b 55 08             	mov    0x8(%ebp),%edx
80104b47:	e9 6d ff ff ff       	jmp    80104ab9 <acquire+0x19>
80104b4c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    panic("acquire");
80104b50:	83 ec 0c             	sub    $0xc,%esp
80104b53:	68 d7 7f 10 80       	push   $0x80107fd7
80104b58:	e8 23 b8 ff ff       	call   80100380 <panic>
80104b5d:	8d 76 00             	lea    0x0(%esi),%esi

80104b60 <popcli>:

void
popcli(void)
{
80104b60:	55                   	push   %ebp
80104b61:	89 e5                	mov    %esp,%ebp
80104b63:	83 ec 08             	sub    $0x8,%esp
  asm volatile("pushfl; popl %0" : "=r" (eflags));
80104b66:	9c                   	pushf  
80104b67:	58                   	pop    %eax
  if(readeflags()&FL_IF)
80104b68:	f6 c4 02             	test   $0x2,%ah
80104b6b:	75 35                	jne    80104ba2 <popcli+0x42>
    panic("popcli - interruptible");
  if(--mycpu()->ncli < 0)
80104b6d:	e8 ae ed ff ff       	call   80103920 <mycpu>
80104b72:	83 a8 a4 00 00 00 01 	subl   $0x1,0xa4(%eax)
80104b79:	78 34                	js     80104baf <popcli+0x4f>
    panic("popcli");
  if(mycpu()->ncli == 0 && mycpu()->intena)
80104b7b:	e8 a0 ed ff ff       	call   80103920 <mycpu>
80104b80:	8b 90 a4 00 00 00    	mov    0xa4(%eax),%edx
80104b86:	85 d2                	test   %edx,%edx
80104b88:	74 06                	je     80104b90 <popcli+0x30>
    sti();
}
80104b8a:	c9                   	leave  
80104b8b:	c3                   	ret    
80104b8c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  if(mycpu()->ncli == 0 && mycpu()->intena)
80104b90:	e8 8b ed ff ff       	call   80103920 <mycpu>
80104b95:	8b 80 a8 00 00 00    	mov    0xa8(%eax),%eax
80104b9b:	85 c0                	test   %eax,%eax
80104b9d:	74 eb                	je     80104b8a <popcli+0x2a>
  asm volatile("sti");
80104b9f:	fb                   	sti    
}
80104ba0:	c9                   	leave  
80104ba1:	c3                   	ret    
    panic("popcli - interruptible");
80104ba2:	83 ec 0c             	sub    $0xc,%esp
80104ba5:	68 df 7f 10 80       	push   $0x80107fdf
80104baa:	e8 d1 b7 ff ff       	call   80100380 <panic>
    panic("popcli");
80104baf:	83 ec 0c             	sub    $0xc,%esp
80104bb2:	68 f6 7f 10 80       	push   $0x80107ff6
80104bb7:	e8 c4 b7 ff ff       	call   80100380 <panic>
80104bbc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80104bc0 <release>:
{
80104bc0:	55                   	push   %ebp
80104bc1:	89 e5                	mov    %esp,%ebp
80104bc3:	56                   	push   %esi
80104bc4:	53                   	push   %ebx
80104bc5:	8b 5d 08             	mov    0x8(%ebp),%ebx
  return lock->locked && lock->cpu == mycpu();
80104bc8:	8b 03                	mov    (%ebx),%eax
80104bca:	85 c0                	test   %eax,%eax
80104bcc:	75 12                	jne    80104be0 <release+0x20>
    panic("release");
80104bce:	83 ec 0c             	sub    $0xc,%esp
80104bd1:	68 fd 7f 10 80       	push   $0x80107ffd
80104bd6:	e8 a5 b7 ff ff       	call   80100380 <panic>
80104bdb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104bdf:	90                   	nop
80104be0:	8b 73 08             	mov    0x8(%ebx),%esi
  return lock->locked && lock->cpu == mycpu();
80104be3:	e8 38 ed ff ff       	call   80103920 <mycpu>
80104be8:	39 c6                	cmp    %eax,%esi
80104bea:	75 e2                	jne    80104bce <release+0xe>
  lk->pcs[0] = 0;
80104bec:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
  lk->cpu = 0;
80104bf3:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
  __sync_synchronize();
80104bfa:	f0 83 0c 24 00       	lock orl $0x0,(%esp)
  asm volatile("movl $0, %0" : "+m" (lk->locked) : );
80104bff:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
}
80104c05:	8d 65 f8             	lea    -0x8(%ebp),%esp
80104c08:	5b                   	pop    %ebx
80104c09:	5e                   	pop    %esi
80104c0a:	5d                   	pop    %ebp
  popcli();
80104c0b:	e9 50 ff ff ff       	jmp    80104b60 <popcli>

80104c10 <memset>:
#include "types.h"
#include "x86.h"

void*
memset(void *dst, int c, uint n)
{
80104c10:	55                   	push   %ebp
80104c11:	89 e5                	mov    %esp,%ebp
80104c13:	57                   	push   %edi
80104c14:	8b 55 08             	mov    0x8(%ebp),%edx
80104c17:	8b 4d 10             	mov    0x10(%ebp),%ecx
80104c1a:	53                   	push   %ebx
80104c1b:	8b 45 0c             	mov    0xc(%ebp),%eax
  if ((int)dst%4 == 0 && n%4 == 0){
80104c1e:	89 d7                	mov    %edx,%edi
80104c20:	09 cf                	or     %ecx,%edi
80104c22:	83 e7 03             	and    $0x3,%edi
80104c25:	75 29                	jne    80104c50 <memset+0x40>
    c &= 0xFF;
80104c27:	0f b6 f8             	movzbl %al,%edi
    stosl(dst, (c<<24)|(c<<16)|(c<<8)|c, n/4);
80104c2a:	c1 e0 18             	shl    $0x18,%eax
80104c2d:	89 fb                	mov    %edi,%ebx
80104c2f:	c1 e9 02             	shr    $0x2,%ecx
80104c32:	c1 e3 10             	shl    $0x10,%ebx
80104c35:	09 d8                	or     %ebx,%eax
80104c37:	09 f8                	or     %edi,%eax
80104c39:	c1 e7 08             	shl    $0x8,%edi
80104c3c:	09 f8                	or     %edi,%eax
  asm volatile("cld; rep stosl" :
80104c3e:	89 d7                	mov    %edx,%edi
80104c40:	fc                   	cld    
80104c41:	f3 ab                	rep stos %eax,%es:(%edi)
  } else
    stosb(dst, c, n);
  return dst;
}
80104c43:	5b                   	pop    %ebx
80104c44:	89 d0                	mov    %edx,%eax
80104c46:	5f                   	pop    %edi
80104c47:	5d                   	pop    %ebp
80104c48:	c3                   	ret    
80104c49:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  asm volatile("cld; rep stosb" :
80104c50:	89 d7                	mov    %edx,%edi
80104c52:	fc                   	cld    
80104c53:	f3 aa                	rep stos %al,%es:(%edi)
80104c55:	5b                   	pop    %ebx
80104c56:	89 d0                	mov    %edx,%eax
80104c58:	5f                   	pop    %edi
80104c59:	5d                   	pop    %ebp
80104c5a:	c3                   	ret    
80104c5b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104c5f:	90                   	nop

80104c60 <memcmp>:

int
memcmp(const void *v1, const void *v2, uint n)
{
80104c60:	55                   	push   %ebp
80104c61:	89 e5                	mov    %esp,%ebp
80104c63:	56                   	push   %esi
80104c64:	8b 75 10             	mov    0x10(%ebp),%esi
80104c67:	8b 55 08             	mov    0x8(%ebp),%edx
80104c6a:	53                   	push   %ebx
80104c6b:	8b 45 0c             	mov    0xc(%ebp),%eax
  const uchar *s1, *s2;

  s1 = v1;
  s2 = v2;
  while(n-- > 0){
80104c6e:	85 f6                	test   %esi,%esi
80104c70:	74 2e                	je     80104ca0 <memcmp+0x40>
80104c72:	01 c6                	add    %eax,%esi
80104c74:	eb 14                	jmp    80104c8a <memcmp+0x2a>
80104c76:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104c7d:	8d 76 00             	lea    0x0(%esi),%esi
    if(*s1 != *s2)
      return *s1 - *s2;
    s1++, s2++;
80104c80:	83 c0 01             	add    $0x1,%eax
80104c83:	83 c2 01             	add    $0x1,%edx
  while(n-- > 0){
80104c86:	39 f0                	cmp    %esi,%eax
80104c88:	74 16                	je     80104ca0 <memcmp+0x40>
    if(*s1 != *s2)
80104c8a:	0f b6 0a             	movzbl (%edx),%ecx
80104c8d:	0f b6 18             	movzbl (%eax),%ebx
80104c90:	38 d9                	cmp    %bl,%cl
80104c92:	74 ec                	je     80104c80 <memcmp+0x20>
      return *s1 - *s2;
80104c94:	0f b6 c1             	movzbl %cl,%eax
80104c97:	29 d8                	sub    %ebx,%eax
  }

  return 0;
}
80104c99:	5b                   	pop    %ebx
80104c9a:	5e                   	pop    %esi
80104c9b:	5d                   	pop    %ebp
80104c9c:	c3                   	ret    
80104c9d:	8d 76 00             	lea    0x0(%esi),%esi
80104ca0:	5b                   	pop    %ebx
  return 0;
80104ca1:	31 c0                	xor    %eax,%eax
}
80104ca3:	5e                   	pop    %esi
80104ca4:	5d                   	pop    %ebp
80104ca5:	c3                   	ret    
80104ca6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104cad:	8d 76 00             	lea    0x0(%esi),%esi

80104cb0 <memmove>:

void*
memmove(void *dst, const void *src, uint n)
{
80104cb0:	55                   	push   %ebp
80104cb1:	89 e5                	mov    %esp,%ebp
80104cb3:	57                   	push   %edi
80104cb4:	8b 55 08             	mov    0x8(%ebp),%edx
80104cb7:	8b 4d 10             	mov    0x10(%ebp),%ecx
80104cba:	56                   	push   %esi
80104cbb:	8b 75 0c             	mov    0xc(%ebp),%esi
  const char *s;
  char *d;

  s = src;
  d = dst;
  if(s < d && s + n > d){
80104cbe:	39 d6                	cmp    %edx,%esi
80104cc0:	73 26                	jae    80104ce8 <memmove+0x38>
80104cc2:	8d 3c 0e             	lea    (%esi,%ecx,1),%edi
80104cc5:	39 fa                	cmp    %edi,%edx
80104cc7:	73 1f                	jae    80104ce8 <memmove+0x38>
80104cc9:	8d 41 ff             	lea    -0x1(%ecx),%eax
    s += n;
    d += n;
    while(n-- > 0)
80104ccc:	85 c9                	test   %ecx,%ecx
80104cce:	74 0c                	je     80104cdc <memmove+0x2c>
      *--d = *--s;
80104cd0:	0f b6 0c 06          	movzbl (%esi,%eax,1),%ecx
80104cd4:	88 0c 02             	mov    %cl,(%edx,%eax,1)
    while(n-- > 0)
80104cd7:	83 e8 01             	sub    $0x1,%eax
80104cda:	73 f4                	jae    80104cd0 <memmove+0x20>
  } else
    while(n-- > 0)
      *d++ = *s++;

  return dst;
}
80104cdc:	5e                   	pop    %esi
80104cdd:	89 d0                	mov    %edx,%eax
80104cdf:	5f                   	pop    %edi
80104ce0:	5d                   	pop    %ebp
80104ce1:	c3                   	ret    
80104ce2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    while(n-- > 0)
80104ce8:	8d 04 0e             	lea    (%esi,%ecx,1),%eax
80104ceb:	89 d7                	mov    %edx,%edi
80104ced:	85 c9                	test   %ecx,%ecx
80104cef:	74 eb                	je     80104cdc <memmove+0x2c>
80104cf1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      *d++ = *s++;
80104cf8:	a4                   	movsb  %ds:(%esi),%es:(%edi)
    while(n-- > 0)
80104cf9:	39 c6                	cmp    %eax,%esi
80104cfb:	75 fb                	jne    80104cf8 <memmove+0x48>
}
80104cfd:	5e                   	pop    %esi
80104cfe:	89 d0                	mov    %edx,%eax
80104d00:	5f                   	pop    %edi
80104d01:	5d                   	pop    %ebp
80104d02:	c3                   	ret    
80104d03:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d0a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104d10 <memcpy>:

// memcpy exists to placate GCC.  Use memmove.
void*
memcpy(void *dst, const void *src, uint n)
{
  return memmove(dst, src, n);
80104d10:	eb 9e                	jmp    80104cb0 <memmove>
80104d12:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d19:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104d20 <strncmp>:
}

int
strncmp(const char *p, const char *q, uint n)
{
80104d20:	55                   	push   %ebp
80104d21:	89 e5                	mov    %esp,%ebp
80104d23:	56                   	push   %esi
80104d24:	8b 75 10             	mov    0x10(%ebp),%esi
80104d27:	8b 4d 08             	mov    0x8(%ebp),%ecx
80104d2a:	53                   	push   %ebx
80104d2b:	8b 55 0c             	mov    0xc(%ebp),%edx
  while(n > 0 && *p && *p == *q)
80104d2e:	85 f6                	test   %esi,%esi
80104d30:	74 2e                	je     80104d60 <strncmp+0x40>
80104d32:	01 d6                	add    %edx,%esi
80104d34:	eb 18                	jmp    80104d4e <strncmp+0x2e>
80104d36:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d3d:	8d 76 00             	lea    0x0(%esi),%esi
80104d40:	38 d8                	cmp    %bl,%al
80104d42:	75 14                	jne    80104d58 <strncmp+0x38>
    n--, p++, q++;
80104d44:	83 c2 01             	add    $0x1,%edx
80104d47:	83 c1 01             	add    $0x1,%ecx
  while(n > 0 && *p && *p == *q)
80104d4a:	39 f2                	cmp    %esi,%edx
80104d4c:	74 12                	je     80104d60 <strncmp+0x40>
80104d4e:	0f b6 01             	movzbl (%ecx),%eax
80104d51:	0f b6 1a             	movzbl (%edx),%ebx
80104d54:	84 c0                	test   %al,%al
80104d56:	75 e8                	jne    80104d40 <strncmp+0x20>
  if(n == 0)
    return 0;
  return (uchar)*p - (uchar)*q;
80104d58:	29 d8                	sub    %ebx,%eax
}
80104d5a:	5b                   	pop    %ebx
80104d5b:	5e                   	pop    %esi
80104d5c:	5d                   	pop    %ebp
80104d5d:	c3                   	ret    
80104d5e:	66 90                	xchg   %ax,%ax
80104d60:	5b                   	pop    %ebx
    return 0;
80104d61:	31 c0                	xor    %eax,%eax
}
80104d63:	5e                   	pop    %esi
80104d64:	5d                   	pop    %ebp
80104d65:	c3                   	ret    
80104d66:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104d6d:	8d 76 00             	lea    0x0(%esi),%esi

80104d70 <strncpy>:

char*
strncpy(char *s, const char *t, int n)
{
80104d70:	55                   	push   %ebp
80104d71:	89 e5                	mov    %esp,%ebp
80104d73:	57                   	push   %edi
80104d74:	56                   	push   %esi
80104d75:	8b 75 08             	mov    0x8(%ebp),%esi
80104d78:	53                   	push   %ebx
80104d79:	8b 4d 10             	mov    0x10(%ebp),%ecx
  char *os;

  os = s;
  while(n-- > 0 && (*s++ = *t++) != 0)
80104d7c:	89 f0                	mov    %esi,%eax
80104d7e:	eb 15                	jmp    80104d95 <strncpy+0x25>
80104d80:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
80104d84:	8b 7d 0c             	mov    0xc(%ebp),%edi
80104d87:	83 c0 01             	add    $0x1,%eax
80104d8a:	0f b6 57 ff          	movzbl -0x1(%edi),%edx
80104d8e:	88 50 ff             	mov    %dl,-0x1(%eax)
80104d91:	84 d2                	test   %dl,%dl
80104d93:	74 09                	je     80104d9e <strncpy+0x2e>
80104d95:	89 cb                	mov    %ecx,%ebx
80104d97:	83 e9 01             	sub    $0x1,%ecx
80104d9a:	85 db                	test   %ebx,%ebx
80104d9c:	7f e2                	jg     80104d80 <strncpy+0x10>
    ;
  while(n-- > 0)
80104d9e:	89 c2                	mov    %eax,%edx
80104da0:	85 c9                	test   %ecx,%ecx
80104da2:	7e 17                	jle    80104dbb <strncpy+0x4b>
80104da4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    *s++ = 0;
80104da8:	83 c2 01             	add    $0x1,%edx
80104dab:	89 c1                	mov    %eax,%ecx
80104dad:	c6 42 ff 00          	movb   $0x0,-0x1(%edx)
  while(n-- > 0)
80104db1:	29 d1                	sub    %edx,%ecx
80104db3:	8d 4c 0b ff          	lea    -0x1(%ebx,%ecx,1),%ecx
80104db7:	85 c9                	test   %ecx,%ecx
80104db9:	7f ed                	jg     80104da8 <strncpy+0x38>
  return os;
}
80104dbb:	5b                   	pop    %ebx
80104dbc:	89 f0                	mov    %esi,%eax
80104dbe:	5e                   	pop    %esi
80104dbf:	5f                   	pop    %edi
80104dc0:	5d                   	pop    %ebp
80104dc1:	c3                   	ret    
80104dc2:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104dc9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80104dd0 <safestrcpy>:

// Like strncpy but guaranteed to NUL-terminate.
char*
safestrcpy(char *s, const char *t, int n)
{
80104dd0:	55                   	push   %ebp
80104dd1:	89 e5                	mov    %esp,%ebp
80104dd3:	56                   	push   %esi
80104dd4:	8b 55 10             	mov    0x10(%ebp),%edx
80104dd7:	8b 75 08             	mov    0x8(%ebp),%esi
80104dda:	53                   	push   %ebx
80104ddb:	8b 45 0c             	mov    0xc(%ebp),%eax
  char *os;

  os = s;
  if(n <= 0)
80104dde:	85 d2                	test   %edx,%edx
80104de0:	7e 25                	jle    80104e07 <safestrcpy+0x37>
80104de2:	8d 5c 10 ff          	lea    -0x1(%eax,%edx,1),%ebx
80104de6:	89 f2                	mov    %esi,%edx
80104de8:	eb 16                	jmp    80104e00 <safestrcpy+0x30>
80104dea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    return os;
  while(--n > 0 && (*s++ = *t++) != 0)
80104df0:	0f b6 08             	movzbl (%eax),%ecx
80104df3:	83 c0 01             	add    $0x1,%eax
80104df6:	83 c2 01             	add    $0x1,%edx
80104df9:	88 4a ff             	mov    %cl,-0x1(%edx)
80104dfc:	84 c9                	test   %cl,%cl
80104dfe:	74 04                	je     80104e04 <safestrcpy+0x34>
80104e00:	39 d8                	cmp    %ebx,%eax
80104e02:	75 ec                	jne    80104df0 <safestrcpy+0x20>
    ;
  *s = 0;
80104e04:	c6 02 00             	movb   $0x0,(%edx)
  return os;
}
80104e07:	89 f0                	mov    %esi,%eax
80104e09:	5b                   	pop    %ebx
80104e0a:	5e                   	pop    %esi
80104e0b:	5d                   	pop    %ebp
80104e0c:	c3                   	ret    
80104e0d:	8d 76 00             	lea    0x0(%esi),%esi

80104e10 <strlen>:

int
strlen(const char *s)
{
80104e10:	55                   	push   %ebp
  int n;

  for(n = 0; s[n]; n++)
80104e11:	31 c0                	xor    %eax,%eax
{
80104e13:	89 e5                	mov    %esp,%ebp
80104e15:	8b 55 08             	mov    0x8(%ebp),%edx
  for(n = 0; s[n]; n++)
80104e18:	80 3a 00             	cmpb   $0x0,(%edx)
80104e1b:	74 0c                	je     80104e29 <strlen+0x19>
80104e1d:	8d 76 00             	lea    0x0(%esi),%esi
80104e20:	83 c0 01             	add    $0x1,%eax
80104e23:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
80104e27:	75 f7                	jne    80104e20 <strlen+0x10>
    ;
  return n;
}
80104e29:	5d                   	pop    %ebp
80104e2a:	c3                   	ret    

80104e2b <swtch>:
# a struct context, and save its address in *old.
# Switch stacks to new and pop previously-saved registers.

.globl swtch
swtch:
  movl 4(%esp), %eax
80104e2b:	8b 44 24 04          	mov    0x4(%esp),%eax
  movl 8(%esp), %edx
80104e2f:	8b 54 24 08          	mov    0x8(%esp),%edx

  # Save old callee-save registers
  pushl %ebp
80104e33:	55                   	push   %ebp
  pushl %ebx
80104e34:	53                   	push   %ebx
  pushl %esi
80104e35:	56                   	push   %esi
  pushl %edi
80104e36:	57                   	push   %edi

  # Switch stacks
  movl %esp, (%eax)
80104e37:	89 20                	mov    %esp,(%eax)
  movl %edx, %esp
80104e39:	89 d4                	mov    %edx,%esp

  # Load new callee-save registers
  popl %edi
80104e3b:	5f                   	pop    %edi
  popl %esi
80104e3c:	5e                   	pop    %esi
  popl %ebx
80104e3d:	5b                   	pop    %ebx
  popl %ebp
80104e3e:	5d                   	pop    %ebp
  ret
80104e3f:	c3                   	ret    

80104e40 <fetchint>:
// to a saved program counter, and then the first argument.

// Fetch the int at addr from the current process.
int
fetchint(uint addr, int *ip)
{
80104e40:	55                   	push   %ebp
80104e41:	89 e5                	mov    %esp,%ebp
80104e43:	53                   	push   %ebx
80104e44:	83 ec 04             	sub    $0x4,%esp
80104e47:	8b 5d 08             	mov    0x8(%ebp),%ebx
  struct proc *curproc = myproc();
80104e4a:	e8 51 eb ff ff       	call   801039a0 <myproc>

  if(addr >= curproc->sz || addr+4 > curproc->sz)
80104e4f:	8b 00                	mov    (%eax),%eax
80104e51:	39 d8                	cmp    %ebx,%eax
80104e53:	76 1b                	jbe    80104e70 <fetchint+0x30>
80104e55:	8d 53 04             	lea    0x4(%ebx),%edx
80104e58:	39 d0                	cmp    %edx,%eax
80104e5a:	72 14                	jb     80104e70 <fetchint+0x30>
    return -1;
  *ip = *(int*)(addr);
80104e5c:	8b 45 0c             	mov    0xc(%ebp),%eax
80104e5f:	8b 13                	mov    (%ebx),%edx
80104e61:	89 10                	mov    %edx,(%eax)
  return 0;
80104e63:	31 c0                	xor    %eax,%eax
}
80104e65:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104e68:	c9                   	leave  
80104e69:	c3                   	ret    
80104e6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    return -1;
80104e70:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80104e75:	eb ee                	jmp    80104e65 <fetchint+0x25>
80104e77:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104e7e:	66 90                	xchg   %ax,%ax

80104e80 <fetchstr>:
// Fetch the nul-terminated string at addr from the current process.
// Doesn't actually copy the string - just sets *pp to point at it.
// Returns length of string, not including nul.
int
fetchstr(uint addr, char **pp)
{
80104e80:	55                   	push   %ebp
80104e81:	89 e5                	mov    %esp,%ebp
80104e83:	53                   	push   %ebx
80104e84:	83 ec 04             	sub    $0x4,%esp
80104e87:	8b 5d 08             	mov    0x8(%ebp),%ebx
  char *s, *ep;
  struct proc *curproc = myproc();
80104e8a:	e8 11 eb ff ff       	call   801039a0 <myproc>

  if(addr >= curproc->sz)
80104e8f:	39 18                	cmp    %ebx,(%eax)
80104e91:	76 2d                	jbe    80104ec0 <fetchstr+0x40>
    return -1;
  *pp = (char*)addr;
80104e93:	8b 55 0c             	mov    0xc(%ebp),%edx
80104e96:	89 1a                	mov    %ebx,(%edx)
  ep = (char*)curproc->sz;
80104e98:	8b 10                	mov    (%eax),%edx
  for(s = *pp; s < ep; s++){
80104e9a:	39 d3                	cmp    %edx,%ebx
80104e9c:	73 22                	jae    80104ec0 <fetchstr+0x40>
80104e9e:	89 d8                	mov    %ebx,%eax
80104ea0:	eb 0d                	jmp    80104eaf <fetchstr+0x2f>
80104ea2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80104ea8:	83 c0 01             	add    $0x1,%eax
80104eab:	39 c2                	cmp    %eax,%edx
80104ead:	76 11                	jbe    80104ec0 <fetchstr+0x40>
    if(*s == 0)
80104eaf:	80 38 00             	cmpb   $0x0,(%eax)
80104eb2:	75 f4                	jne    80104ea8 <fetchstr+0x28>
      return s - *pp;
80104eb4:	29 d8                	sub    %ebx,%eax
  }
  return -1;
}
80104eb6:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80104eb9:	c9                   	leave  
80104eba:	c3                   	ret    
80104ebb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80104ebf:	90                   	nop
80104ec0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
    return -1;
80104ec3:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104ec8:	c9                   	leave  
80104ec9:	c3                   	ret    
80104eca:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80104ed0 <argint>:

// Fetch the nth 32-bit system call argument.
int
argint(int n, int *ip)
{
80104ed0:	55                   	push   %ebp
80104ed1:	89 e5                	mov    %esp,%ebp
80104ed3:	56                   	push   %esi
80104ed4:	53                   	push   %ebx
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104ed5:	e8 c6 ea ff ff       	call   801039a0 <myproc>
80104eda:	8b 55 08             	mov    0x8(%ebp),%edx
80104edd:	8b 40 18             	mov    0x18(%eax),%eax
80104ee0:	8b 40 44             	mov    0x44(%eax),%eax
80104ee3:	8d 1c 90             	lea    (%eax,%edx,4),%ebx
  struct proc *curproc = myproc();
80104ee6:	e8 b5 ea ff ff       	call   801039a0 <myproc>
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104eeb:	8d 73 04             	lea    0x4(%ebx),%esi
  if(addr >= curproc->sz || addr+4 > curproc->sz)
80104eee:	8b 00                	mov    (%eax),%eax
80104ef0:	39 c6                	cmp    %eax,%esi
80104ef2:	73 1c                	jae    80104f10 <argint+0x40>
80104ef4:	8d 53 08             	lea    0x8(%ebx),%edx
80104ef7:	39 d0                	cmp    %edx,%eax
80104ef9:	72 15                	jb     80104f10 <argint+0x40>
  *ip = *(int*)(addr);
80104efb:	8b 45 0c             	mov    0xc(%ebp),%eax
80104efe:	8b 53 04             	mov    0x4(%ebx),%edx
80104f01:	89 10                	mov    %edx,(%eax)
  return 0;
80104f03:	31 c0                	xor    %eax,%eax
}
80104f05:	5b                   	pop    %ebx
80104f06:	5e                   	pop    %esi
80104f07:	5d                   	pop    %ebp
80104f08:	c3                   	ret    
80104f09:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    return -1;
80104f10:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104f15:	eb ee                	jmp    80104f05 <argint+0x35>
80104f17:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104f1e:	66 90                	xchg   %ax,%ax

80104f20 <argptr>:
// Fetch the nth word-sized system call argument as a pointer
// to a block of memory of size bytes.  Check that the pointer
// lies within the process address space.
int
argptr(int n, char **pp, int size)
{
80104f20:	55                   	push   %ebp
80104f21:	89 e5                	mov    %esp,%ebp
80104f23:	57                   	push   %edi
80104f24:	56                   	push   %esi
80104f25:	53                   	push   %ebx
80104f26:	83 ec 0c             	sub    $0xc,%esp
  int i;
  struct proc *curproc = myproc();
80104f29:	e8 72 ea ff ff       	call   801039a0 <myproc>
80104f2e:	89 c6                	mov    %eax,%esi
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104f30:	e8 6b ea ff ff       	call   801039a0 <myproc>
80104f35:	8b 55 08             	mov    0x8(%ebp),%edx
80104f38:	8b 40 18             	mov    0x18(%eax),%eax
80104f3b:	8b 40 44             	mov    0x44(%eax),%eax
80104f3e:	8d 1c 90             	lea    (%eax,%edx,4),%ebx
  struct proc *curproc = myproc();
80104f41:	e8 5a ea ff ff       	call   801039a0 <myproc>
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104f46:	8d 7b 04             	lea    0x4(%ebx),%edi
  if(addr >= curproc->sz || addr+4 > curproc->sz)
80104f49:	8b 00                	mov    (%eax),%eax
80104f4b:	39 c7                	cmp    %eax,%edi
80104f4d:	73 31                	jae    80104f80 <argptr+0x60>
80104f4f:	8d 4b 08             	lea    0x8(%ebx),%ecx
80104f52:	39 c8                	cmp    %ecx,%eax
80104f54:	72 2a                	jb     80104f80 <argptr+0x60>
 
  if(argint(n, &i) < 0)
    return -1;
  if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz)
80104f56:	8b 55 10             	mov    0x10(%ebp),%edx
  *ip = *(int*)(addr);
80104f59:	8b 43 04             	mov    0x4(%ebx),%eax
  if(size < 0 || (uint)i >= curproc->sz || (uint)i+size > curproc->sz)
80104f5c:	85 d2                	test   %edx,%edx
80104f5e:	78 20                	js     80104f80 <argptr+0x60>
80104f60:	8b 16                	mov    (%esi),%edx
80104f62:	39 c2                	cmp    %eax,%edx
80104f64:	76 1a                	jbe    80104f80 <argptr+0x60>
80104f66:	8b 5d 10             	mov    0x10(%ebp),%ebx
80104f69:	01 c3                	add    %eax,%ebx
80104f6b:	39 da                	cmp    %ebx,%edx
80104f6d:	72 11                	jb     80104f80 <argptr+0x60>
    return -1;
  *pp = (char*)i;
80104f6f:	8b 55 0c             	mov    0xc(%ebp),%edx
80104f72:	89 02                	mov    %eax,(%edx)
  return 0;
80104f74:	31 c0                	xor    %eax,%eax
}
80104f76:	83 c4 0c             	add    $0xc,%esp
80104f79:	5b                   	pop    %ebx
80104f7a:	5e                   	pop    %esi
80104f7b:	5f                   	pop    %edi
80104f7c:	5d                   	pop    %ebp
80104f7d:	c3                   	ret    
80104f7e:	66 90                	xchg   %ax,%ax
    return -1;
80104f80:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80104f85:	eb ef                	jmp    80104f76 <argptr+0x56>
80104f87:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104f8e:	66 90                	xchg   %ax,%ax

80104f90 <argstr>:
// Check that the pointer is valid and the string is nul-terminated.
// (There is no shared writable memory, so the string can't change
// between this check and being used by the kernel.)
int
argstr(int n, char **pp)
{
80104f90:	55                   	push   %ebp
80104f91:	89 e5                	mov    %esp,%ebp
80104f93:	56                   	push   %esi
80104f94:	53                   	push   %ebx
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104f95:	e8 06 ea ff ff       	call   801039a0 <myproc>
80104f9a:	8b 55 08             	mov    0x8(%ebp),%edx
80104f9d:	8b 40 18             	mov    0x18(%eax),%eax
80104fa0:	8b 40 44             	mov    0x44(%eax),%eax
80104fa3:	8d 1c 90             	lea    (%eax,%edx,4),%ebx
  struct proc *curproc = myproc();
80104fa6:	e8 f5 e9 ff ff       	call   801039a0 <myproc>
  return fetchint((myproc()->tf->esp) + 4 + 4*n, ip);
80104fab:	8d 73 04             	lea    0x4(%ebx),%esi
  if(addr >= curproc->sz || addr+4 > curproc->sz)
80104fae:	8b 00                	mov    (%eax),%eax
80104fb0:	39 c6                	cmp    %eax,%esi
80104fb2:	73 44                	jae    80104ff8 <argstr+0x68>
80104fb4:	8d 53 08             	lea    0x8(%ebx),%edx
80104fb7:	39 d0                	cmp    %edx,%eax
80104fb9:	72 3d                	jb     80104ff8 <argstr+0x68>
  *ip = *(int*)(addr);
80104fbb:	8b 5b 04             	mov    0x4(%ebx),%ebx
  struct proc *curproc = myproc();
80104fbe:	e8 dd e9 ff ff       	call   801039a0 <myproc>
  if(addr >= curproc->sz)
80104fc3:	3b 18                	cmp    (%eax),%ebx
80104fc5:	73 31                	jae    80104ff8 <argstr+0x68>
  *pp = (char*)addr;
80104fc7:	8b 55 0c             	mov    0xc(%ebp),%edx
80104fca:	89 1a                	mov    %ebx,(%edx)
  ep = (char*)curproc->sz;
80104fcc:	8b 10                	mov    (%eax),%edx
  for(s = *pp; s < ep; s++){
80104fce:	39 d3                	cmp    %edx,%ebx
80104fd0:	73 26                	jae    80104ff8 <argstr+0x68>
80104fd2:	89 d8                	mov    %ebx,%eax
80104fd4:	eb 11                	jmp    80104fe7 <argstr+0x57>
80104fd6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80104fdd:	8d 76 00             	lea    0x0(%esi),%esi
80104fe0:	83 c0 01             	add    $0x1,%eax
80104fe3:	39 c2                	cmp    %eax,%edx
80104fe5:	76 11                	jbe    80104ff8 <argstr+0x68>
    if(*s == 0)
80104fe7:	80 38 00             	cmpb   $0x0,(%eax)
80104fea:	75 f4                	jne    80104fe0 <argstr+0x50>
      return s - *pp;
80104fec:	29 d8                	sub    %ebx,%eax
  int addr;
  if(argint(n, &addr) < 0)
    return -1;
  return fetchstr(addr, pp);
}
80104fee:	5b                   	pop    %ebx
80104fef:	5e                   	pop    %esi
80104ff0:	5d                   	pop    %ebp
80104ff1:	c3                   	ret    
80104ff2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80104ff8:	5b                   	pop    %ebx
    return -1;
80104ff9:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80104ffe:	5e                   	pop    %esi
80104fff:	5d                   	pop    %ebp
80105000:	c3                   	ret    
80105001:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105008:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010500f:	90                   	nop

80105010 <syscall>:

};

void
syscall(void)
{
80105010:	55                   	push   %ebp
80105011:	89 e5                	mov    %esp,%ebp
80105013:	53                   	push   %ebx
80105014:	83 ec 04             	sub    $0x4,%esp
  int num;
  struct proc *curproc = myproc();
80105017:	e8 84 e9 ff ff       	call   801039a0 <myproc>
8010501c:	89 c3                	mov    %eax,%ebx

  num = curproc->tf->eax;
8010501e:	8b 40 18             	mov    0x18(%eax),%eax
80105021:	8b 40 1c             	mov    0x1c(%eax),%eax
  if(num > 0 && num < NELEM(syscalls) && syscalls[num]) {
80105024:	8d 50 ff             	lea    -0x1(%eax),%edx
80105027:	83 fa 1c             	cmp    $0x1c,%edx
8010502a:	77 24                	ja     80105050 <syscall+0x40>
8010502c:	8b 14 85 40 80 10 80 	mov    -0x7fef7fc0(,%eax,4),%edx
80105033:	85 d2                	test   %edx,%edx
80105035:	74 19                	je     80105050 <syscall+0x40>
    curproc->tf->eax = syscalls[num]();
80105037:	ff d2                	call   *%edx
80105039:	89 c2                	mov    %eax,%edx
8010503b:	8b 43 18             	mov    0x18(%ebx),%eax
8010503e:	89 50 1c             	mov    %edx,0x1c(%eax)
  } else {
    cprintf("%d %s: unknown sys call %d\n",
            curproc->pid, curproc->name, num);
    curproc->tf->eax = -1;
  }
}
80105041:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105044:	c9                   	leave  
80105045:	c3                   	ret    
80105046:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010504d:	8d 76 00             	lea    0x0(%esi),%esi
    cprintf("%d %s: unknown sys call %d\n",
80105050:	50                   	push   %eax
            curproc->pid, curproc->name, num);
80105051:	8d 43 6c             	lea    0x6c(%ebx),%eax
    cprintf("%d %s: unknown sys call %d\n",
80105054:	50                   	push   %eax
80105055:	ff 73 10             	push   0x10(%ebx)
80105058:	68 05 80 10 80       	push   $0x80108005
8010505d:	e8 3e b6 ff ff       	call   801006a0 <cprintf>
    curproc->tf->eax = -1;
80105062:	8b 43 18             	mov    0x18(%ebx),%eax
80105065:	83 c4 10             	add    $0x10,%esp
80105068:	c7 40 1c ff ff ff ff 	movl   $0xffffffff,0x1c(%eax)
}
8010506f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105072:	c9                   	leave  
80105073:	c3                   	ret    
80105074:	66 90                	xchg   %ax,%ax
80105076:	66 90                	xchg   %ax,%ax
80105078:	66 90                	xchg   %ax,%ax
8010507a:	66 90                	xchg   %ax,%ax
8010507c:	66 90                	xchg   %ax,%ax
8010507e:	66 90                	xchg   %ax,%ax

80105080 <create>:
  return -1;
}

static struct inode*
create(char *path, short type, short major, short minor)
{
80105080:	55                   	push   %ebp
80105081:	89 e5                	mov    %esp,%ebp
80105083:	57                   	push   %edi
80105084:	56                   	push   %esi
  uint off;
  struct inode *ip, *dp;
  char name[DIRSIZ];

  if((dp = nameiparent(path, name)) == 0)
80105085:	8d 7d da             	lea    -0x26(%ebp),%edi
{
80105088:	53                   	push   %ebx
80105089:	83 ec 44             	sub    $0x44,%esp
8010508c:	89 4d c0             	mov    %ecx,-0x40(%ebp)
8010508f:	8b 4d 08             	mov    0x8(%ebp),%ecx
  if((dp = nameiparent(path, name)) == 0)
80105092:	57                   	push   %edi
80105093:	50                   	push   %eax
{
80105094:	89 55 c4             	mov    %edx,-0x3c(%ebp)
80105097:	89 4d bc             	mov    %ecx,-0x44(%ebp)
  if((dp = nameiparent(path, name)) == 0)
8010509a:	e8 41 d0 ff ff       	call   801020e0 <nameiparent>
8010509f:	83 c4 10             	add    $0x10,%esp
801050a2:	85 c0                	test   %eax,%eax
801050a4:	0f 84 46 01 00 00    	je     801051f0 <create+0x170>
    return 0;
  ilock(dp);
801050aa:	83 ec 0c             	sub    $0xc,%esp
801050ad:	89 c3                	mov    %eax,%ebx
801050af:	50                   	push   %eax
801050b0:	e8 eb c6 ff ff       	call   801017a0 <ilock>

  if((ip = dirlookup(dp, name, &off)) != 0){
801050b5:	83 c4 0c             	add    $0xc,%esp
801050b8:	8d 45 d4             	lea    -0x2c(%ebp),%eax
801050bb:	50                   	push   %eax
801050bc:	57                   	push   %edi
801050bd:	53                   	push   %ebx
801050be:	e8 3d cc ff ff       	call   80101d00 <dirlookup>
801050c3:	83 c4 10             	add    $0x10,%esp
801050c6:	89 c6                	mov    %eax,%esi
801050c8:	85 c0                	test   %eax,%eax
801050ca:	74 54                	je     80105120 <create+0xa0>
    iunlockput(dp);
801050cc:	83 ec 0c             	sub    $0xc,%esp
801050cf:	53                   	push   %ebx
801050d0:	e8 5b c9 ff ff       	call   80101a30 <iunlockput>
    ilock(ip);
801050d5:	89 34 24             	mov    %esi,(%esp)
801050d8:	e8 c3 c6 ff ff       	call   801017a0 <ilock>
    if(type == T_FILE && ip->type == T_FILE)
801050dd:	83 c4 10             	add    $0x10,%esp
801050e0:	66 83 7d c4 02       	cmpw   $0x2,-0x3c(%ebp)
801050e5:	75 19                	jne    80105100 <create+0x80>
801050e7:	66 83 7e 50 02       	cmpw   $0x2,0x50(%esi)
801050ec:	75 12                	jne    80105100 <create+0x80>
    panic("create: dirlink");

  iunlockput(dp);

  return ip;
}
801050ee:	8d 65 f4             	lea    -0xc(%ebp),%esp
801050f1:	89 f0                	mov    %esi,%eax
801050f3:	5b                   	pop    %ebx
801050f4:	5e                   	pop    %esi
801050f5:	5f                   	pop    %edi
801050f6:	5d                   	pop    %ebp
801050f7:	c3                   	ret    
801050f8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801050ff:	90                   	nop
    iunlockput(ip);
80105100:	83 ec 0c             	sub    $0xc,%esp
80105103:	56                   	push   %esi
    return 0;
80105104:	31 f6                	xor    %esi,%esi
    iunlockput(ip);
80105106:	e8 25 c9 ff ff       	call   80101a30 <iunlockput>
    return 0;
8010510b:	83 c4 10             	add    $0x10,%esp
}
8010510e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105111:	89 f0                	mov    %esi,%eax
80105113:	5b                   	pop    %ebx
80105114:	5e                   	pop    %esi
80105115:	5f                   	pop    %edi
80105116:	5d                   	pop    %ebp
80105117:	c3                   	ret    
80105118:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010511f:	90                   	nop
  if((ip = ialloc(dp->dev, type)) == 0)
80105120:	0f bf 45 c4          	movswl -0x3c(%ebp),%eax
80105124:	83 ec 08             	sub    $0x8,%esp
80105127:	50                   	push   %eax
80105128:	ff 33                	push   (%ebx)
8010512a:	e8 01 c5 ff ff       	call   80101630 <ialloc>
8010512f:	83 c4 10             	add    $0x10,%esp
80105132:	89 c6                	mov    %eax,%esi
80105134:	85 c0                	test   %eax,%eax
80105136:	0f 84 cd 00 00 00    	je     80105209 <create+0x189>
  ilock(ip);
8010513c:	83 ec 0c             	sub    $0xc,%esp
8010513f:	50                   	push   %eax
80105140:	e8 5b c6 ff ff       	call   801017a0 <ilock>
  ip->major = major;
80105145:	0f b7 45 c0          	movzwl -0x40(%ebp),%eax
80105149:	66 89 46 52          	mov    %ax,0x52(%esi)
  ip->minor = minor;
8010514d:	0f b7 45 bc          	movzwl -0x44(%ebp),%eax
80105151:	66 89 46 54          	mov    %ax,0x54(%esi)
  ip->nlink = 1;
80105155:	b8 01 00 00 00       	mov    $0x1,%eax
8010515a:	66 89 46 56          	mov    %ax,0x56(%esi)
  iupdate(ip);
8010515e:	89 34 24             	mov    %esi,(%esp)
80105161:	e8 8a c5 ff ff       	call   801016f0 <iupdate>
  if(type == T_DIR){  // Create . and .. entries.
80105166:	83 c4 10             	add    $0x10,%esp
80105169:	66 83 7d c4 01       	cmpw   $0x1,-0x3c(%ebp)
8010516e:	74 30                	je     801051a0 <create+0x120>
  if(dirlink(dp, name, ip->inum) < 0)
80105170:	83 ec 04             	sub    $0x4,%esp
80105173:	ff 76 04             	push   0x4(%esi)
80105176:	57                   	push   %edi
80105177:	53                   	push   %ebx
80105178:	e8 83 ce ff ff       	call   80102000 <dirlink>
8010517d:	83 c4 10             	add    $0x10,%esp
80105180:	85 c0                	test   %eax,%eax
80105182:	78 78                	js     801051fc <create+0x17c>
  iunlockput(dp);
80105184:	83 ec 0c             	sub    $0xc,%esp
80105187:	53                   	push   %ebx
80105188:	e8 a3 c8 ff ff       	call   80101a30 <iunlockput>
  return ip;
8010518d:	83 c4 10             	add    $0x10,%esp
}
80105190:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105193:	89 f0                	mov    %esi,%eax
80105195:	5b                   	pop    %ebx
80105196:	5e                   	pop    %esi
80105197:	5f                   	pop    %edi
80105198:	5d                   	pop    %ebp
80105199:	c3                   	ret    
8010519a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    iupdate(dp);
801051a0:	83 ec 0c             	sub    $0xc,%esp
    dp->nlink++;  // for ".."
801051a3:	66 83 43 56 01       	addw   $0x1,0x56(%ebx)
    iupdate(dp);
801051a8:	53                   	push   %ebx
801051a9:	e8 42 c5 ff ff       	call   801016f0 <iupdate>
    if(dirlink(ip, ".", ip->inum) < 0 || dirlink(ip, "..", dp->inum) < 0)
801051ae:	83 c4 0c             	add    $0xc,%esp
801051b1:	ff 76 04             	push   0x4(%esi)
801051b4:	68 d4 80 10 80       	push   $0x801080d4
801051b9:	56                   	push   %esi
801051ba:	e8 41 ce ff ff       	call   80102000 <dirlink>
801051bf:	83 c4 10             	add    $0x10,%esp
801051c2:	85 c0                	test   %eax,%eax
801051c4:	78 18                	js     801051de <create+0x15e>
801051c6:	83 ec 04             	sub    $0x4,%esp
801051c9:	ff 73 04             	push   0x4(%ebx)
801051cc:	68 d3 80 10 80       	push   $0x801080d3
801051d1:	56                   	push   %esi
801051d2:	e8 29 ce ff ff       	call   80102000 <dirlink>
801051d7:	83 c4 10             	add    $0x10,%esp
801051da:	85 c0                	test   %eax,%eax
801051dc:	79 92                	jns    80105170 <create+0xf0>
      panic("create dots");
801051de:	83 ec 0c             	sub    $0xc,%esp
801051e1:	68 c7 80 10 80       	push   $0x801080c7
801051e6:	e8 95 b1 ff ff       	call   80100380 <panic>
801051eb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801051ef:	90                   	nop
}
801051f0:	8d 65 f4             	lea    -0xc(%ebp),%esp
    return 0;
801051f3:	31 f6                	xor    %esi,%esi
}
801051f5:	5b                   	pop    %ebx
801051f6:	89 f0                	mov    %esi,%eax
801051f8:	5e                   	pop    %esi
801051f9:	5f                   	pop    %edi
801051fa:	5d                   	pop    %ebp
801051fb:	c3                   	ret    
    panic("create: dirlink");
801051fc:	83 ec 0c             	sub    $0xc,%esp
801051ff:	68 d6 80 10 80       	push   $0x801080d6
80105204:	e8 77 b1 ff ff       	call   80100380 <panic>
    panic("create: ialloc");
80105209:	83 ec 0c             	sub    $0xc,%esp
8010520c:	68 b8 80 10 80       	push   $0x801080b8
80105211:	e8 6a b1 ff ff       	call   80100380 <panic>
80105216:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010521d:	8d 76 00             	lea    0x0(%esi),%esi

80105220 <sys_dup>:
{
80105220:	55                   	push   %ebp
80105221:	89 e5                	mov    %esp,%ebp
80105223:	56                   	push   %esi
80105224:	53                   	push   %ebx
  if(argint(n, &fd) < 0)
80105225:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
80105228:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
8010522b:	50                   	push   %eax
8010522c:	6a 00                	push   $0x0
8010522e:	e8 9d fc ff ff       	call   80104ed0 <argint>
80105233:	83 c4 10             	add    $0x10,%esp
80105236:	85 c0                	test   %eax,%eax
80105238:	78 36                	js     80105270 <sys_dup+0x50>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
8010523a:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
8010523e:	77 30                	ja     80105270 <sys_dup+0x50>
80105240:	e8 5b e7 ff ff       	call   801039a0 <myproc>
80105245:	8b 55 f4             	mov    -0xc(%ebp),%edx
80105248:	8b 74 90 28          	mov    0x28(%eax,%edx,4),%esi
8010524c:	85 f6                	test   %esi,%esi
8010524e:	74 20                	je     80105270 <sys_dup+0x50>
  struct proc *curproc = myproc();
80105250:	e8 4b e7 ff ff       	call   801039a0 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80105255:	31 db                	xor    %ebx,%ebx
80105257:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010525e:	66 90                	xchg   %ax,%ax
    if(curproc->ofile[fd] == 0){
80105260:	8b 54 98 28          	mov    0x28(%eax,%ebx,4),%edx
80105264:	85 d2                	test   %edx,%edx
80105266:	74 18                	je     80105280 <sys_dup+0x60>
  for(fd = 0; fd < NOFILE; fd++){
80105268:	83 c3 01             	add    $0x1,%ebx
8010526b:	83 fb 10             	cmp    $0x10,%ebx
8010526e:	75 f0                	jne    80105260 <sys_dup+0x40>
}
80105270:	8d 65 f8             	lea    -0x8(%ebp),%esp
    return -1;
80105273:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
}
80105278:	89 d8                	mov    %ebx,%eax
8010527a:	5b                   	pop    %ebx
8010527b:	5e                   	pop    %esi
8010527c:	5d                   	pop    %ebp
8010527d:	c3                   	ret    
8010527e:	66 90                	xchg   %ax,%ax
  filedup(f);
80105280:	83 ec 0c             	sub    $0xc,%esp
      curproc->ofile[fd] = f;
80105283:	89 74 98 28          	mov    %esi,0x28(%eax,%ebx,4)
  filedup(f);
80105287:	56                   	push   %esi
80105288:	e8 13 bc ff ff       	call   80100ea0 <filedup>
  return fd;
8010528d:	83 c4 10             	add    $0x10,%esp
}
80105290:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105293:	89 d8                	mov    %ebx,%eax
80105295:	5b                   	pop    %ebx
80105296:	5e                   	pop    %esi
80105297:	5d                   	pop    %ebp
80105298:	c3                   	ret    
80105299:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801052a0 <sys_read>:
{
801052a0:	55                   	push   %ebp
801052a1:	89 e5                	mov    %esp,%ebp
801052a3:	56                   	push   %esi
801052a4:	53                   	push   %ebx
  if(argint(n, &fd) < 0)
801052a5:	8d 5d f4             	lea    -0xc(%ebp),%ebx
{
801052a8:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
801052ab:	53                   	push   %ebx
801052ac:	6a 00                	push   $0x0
801052ae:	e8 1d fc ff ff       	call   80104ed0 <argint>
801052b3:	83 c4 10             	add    $0x10,%esp
801052b6:	85 c0                	test   %eax,%eax
801052b8:	78 5e                	js     80105318 <sys_read+0x78>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
801052ba:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
801052be:	77 58                	ja     80105318 <sys_read+0x78>
801052c0:	e8 db e6 ff ff       	call   801039a0 <myproc>
801052c5:	8b 55 f4             	mov    -0xc(%ebp),%edx
801052c8:	8b 74 90 28          	mov    0x28(%eax,%edx,4),%esi
801052cc:	85 f6                	test   %esi,%esi
801052ce:	74 48                	je     80105318 <sys_read+0x78>
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
801052d0:	83 ec 08             	sub    $0x8,%esp
801052d3:	8d 45 f0             	lea    -0x10(%ebp),%eax
801052d6:	50                   	push   %eax
801052d7:	6a 02                	push   $0x2
801052d9:	e8 f2 fb ff ff       	call   80104ed0 <argint>
801052de:	83 c4 10             	add    $0x10,%esp
801052e1:	85 c0                	test   %eax,%eax
801052e3:	78 33                	js     80105318 <sys_read+0x78>
801052e5:	83 ec 04             	sub    $0x4,%esp
801052e8:	ff 75 f0             	push   -0x10(%ebp)
801052eb:	53                   	push   %ebx
801052ec:	6a 01                	push   $0x1
801052ee:	e8 2d fc ff ff       	call   80104f20 <argptr>
801052f3:	83 c4 10             	add    $0x10,%esp
801052f6:	85 c0                	test   %eax,%eax
801052f8:	78 1e                	js     80105318 <sys_read+0x78>
  return fileread(f, p, n);
801052fa:	83 ec 04             	sub    $0x4,%esp
801052fd:	ff 75 f0             	push   -0x10(%ebp)
80105300:	ff 75 f4             	push   -0xc(%ebp)
80105303:	56                   	push   %esi
80105304:	e8 17 bd ff ff       	call   80101020 <fileread>
80105309:	83 c4 10             	add    $0x10,%esp
}
8010530c:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010530f:	5b                   	pop    %ebx
80105310:	5e                   	pop    %esi
80105311:	5d                   	pop    %ebp
80105312:	c3                   	ret    
80105313:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105317:	90                   	nop
    return -1;
80105318:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010531d:	eb ed                	jmp    8010530c <sys_read+0x6c>
8010531f:	90                   	nop

80105320 <sys_write>:
{
80105320:	55                   	push   %ebp
80105321:	89 e5                	mov    %esp,%ebp
80105323:	56                   	push   %esi
80105324:	53                   	push   %ebx
  if(argint(n, &fd) < 0)
80105325:	8d 5d f4             	lea    -0xc(%ebp),%ebx
{
80105328:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
8010532b:	53                   	push   %ebx
8010532c:	6a 00                	push   $0x0
8010532e:	e8 9d fb ff ff       	call   80104ed0 <argint>
80105333:	83 c4 10             	add    $0x10,%esp
80105336:	85 c0                	test   %eax,%eax
80105338:	78 5e                	js     80105398 <sys_write+0x78>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
8010533a:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
8010533e:	77 58                	ja     80105398 <sys_write+0x78>
80105340:	e8 5b e6 ff ff       	call   801039a0 <myproc>
80105345:	8b 55 f4             	mov    -0xc(%ebp),%edx
80105348:	8b 74 90 28          	mov    0x28(%eax,%edx,4),%esi
8010534c:	85 f6                	test   %esi,%esi
8010534e:	74 48                	je     80105398 <sys_write+0x78>
  if(argfd(0, 0, &f) < 0 || argint(2, &n) < 0 || argptr(1, &p, n) < 0)
80105350:	83 ec 08             	sub    $0x8,%esp
80105353:	8d 45 f0             	lea    -0x10(%ebp),%eax
80105356:	50                   	push   %eax
80105357:	6a 02                	push   $0x2
80105359:	e8 72 fb ff ff       	call   80104ed0 <argint>
8010535e:	83 c4 10             	add    $0x10,%esp
80105361:	85 c0                	test   %eax,%eax
80105363:	78 33                	js     80105398 <sys_write+0x78>
80105365:	83 ec 04             	sub    $0x4,%esp
80105368:	ff 75 f0             	push   -0x10(%ebp)
8010536b:	53                   	push   %ebx
8010536c:	6a 01                	push   $0x1
8010536e:	e8 ad fb ff ff       	call   80104f20 <argptr>
80105373:	83 c4 10             	add    $0x10,%esp
80105376:	85 c0                	test   %eax,%eax
80105378:	78 1e                	js     80105398 <sys_write+0x78>
  return filewrite(f, p, n);
8010537a:	83 ec 04             	sub    $0x4,%esp
8010537d:	ff 75 f0             	push   -0x10(%ebp)
80105380:	ff 75 f4             	push   -0xc(%ebp)
80105383:	56                   	push   %esi
80105384:	e8 27 bd ff ff       	call   801010b0 <filewrite>
80105389:	83 c4 10             	add    $0x10,%esp
}
8010538c:	8d 65 f8             	lea    -0x8(%ebp),%esp
8010538f:	5b                   	pop    %ebx
80105390:	5e                   	pop    %esi
80105391:	5d                   	pop    %ebp
80105392:	c3                   	ret    
80105393:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105397:	90                   	nop
    return -1;
80105398:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010539d:	eb ed                	jmp    8010538c <sys_write+0x6c>
8010539f:	90                   	nop

801053a0 <sys_close>:
{
801053a0:	55                   	push   %ebp
801053a1:	89 e5                	mov    %esp,%ebp
801053a3:	56                   	push   %esi
801053a4:	53                   	push   %ebx
  if(argint(n, &fd) < 0)
801053a5:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
801053a8:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
801053ab:	50                   	push   %eax
801053ac:	6a 00                	push   $0x0
801053ae:	e8 1d fb ff ff       	call   80104ed0 <argint>
801053b3:	83 c4 10             	add    $0x10,%esp
801053b6:	85 c0                	test   %eax,%eax
801053b8:	78 3e                	js     801053f8 <sys_close+0x58>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
801053ba:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
801053be:	77 38                	ja     801053f8 <sys_close+0x58>
801053c0:	e8 db e5 ff ff       	call   801039a0 <myproc>
801053c5:	8b 55 f4             	mov    -0xc(%ebp),%edx
801053c8:	8d 5a 08             	lea    0x8(%edx),%ebx
801053cb:	8b 74 98 08          	mov    0x8(%eax,%ebx,4),%esi
801053cf:	85 f6                	test   %esi,%esi
801053d1:	74 25                	je     801053f8 <sys_close+0x58>
  myproc()->ofile[fd] = 0;
801053d3:	e8 c8 e5 ff ff       	call   801039a0 <myproc>
  fileclose(f);
801053d8:	83 ec 0c             	sub    $0xc,%esp
  myproc()->ofile[fd] = 0;
801053db:	c7 44 98 08 00 00 00 	movl   $0x0,0x8(%eax,%ebx,4)
801053e2:	00 
  fileclose(f);
801053e3:	56                   	push   %esi
801053e4:	e8 07 bb ff ff       	call   80100ef0 <fileclose>
  return 0;
801053e9:	83 c4 10             	add    $0x10,%esp
801053ec:	31 c0                	xor    %eax,%eax
}
801053ee:	8d 65 f8             	lea    -0x8(%ebp),%esp
801053f1:	5b                   	pop    %ebx
801053f2:	5e                   	pop    %esi
801053f3:	5d                   	pop    %ebp
801053f4:	c3                   	ret    
801053f5:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
801053f8:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
801053fd:	eb ef                	jmp    801053ee <sys_close+0x4e>
801053ff:	90                   	nop

80105400 <sys_fstat>:
{
80105400:	55                   	push   %ebp
80105401:	89 e5                	mov    %esp,%ebp
80105403:	56                   	push   %esi
80105404:	53                   	push   %ebx
  if(argint(n, &fd) < 0)
80105405:	8d 5d f4             	lea    -0xc(%ebp),%ebx
{
80105408:	83 ec 18             	sub    $0x18,%esp
  if(argint(n, &fd) < 0)
8010540b:	53                   	push   %ebx
8010540c:	6a 00                	push   $0x0
8010540e:	e8 bd fa ff ff       	call   80104ed0 <argint>
80105413:	83 c4 10             	add    $0x10,%esp
80105416:	85 c0                	test   %eax,%eax
80105418:	78 46                	js     80105460 <sys_fstat+0x60>
  if(fd < 0 || fd >= NOFILE || (f=myproc()->ofile[fd]) == 0)
8010541a:	83 7d f4 0f          	cmpl   $0xf,-0xc(%ebp)
8010541e:	77 40                	ja     80105460 <sys_fstat+0x60>
80105420:	e8 7b e5 ff ff       	call   801039a0 <myproc>
80105425:	8b 55 f4             	mov    -0xc(%ebp),%edx
80105428:	8b 74 90 28          	mov    0x28(%eax,%edx,4),%esi
8010542c:	85 f6                	test   %esi,%esi
8010542e:	74 30                	je     80105460 <sys_fstat+0x60>
  if(argfd(0, 0, &f) < 0 || argptr(1, (void*)&st, sizeof(*st)) < 0)
80105430:	83 ec 04             	sub    $0x4,%esp
80105433:	6a 14                	push   $0x14
80105435:	53                   	push   %ebx
80105436:	6a 01                	push   $0x1
80105438:	e8 e3 fa ff ff       	call   80104f20 <argptr>
8010543d:	83 c4 10             	add    $0x10,%esp
80105440:	85 c0                	test   %eax,%eax
80105442:	78 1c                	js     80105460 <sys_fstat+0x60>
  return filestat(f, st);
80105444:	83 ec 08             	sub    $0x8,%esp
80105447:	ff 75 f4             	push   -0xc(%ebp)
8010544a:	56                   	push   %esi
8010544b:	e8 80 bb ff ff       	call   80100fd0 <filestat>
80105450:	83 c4 10             	add    $0x10,%esp
}
80105453:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105456:	5b                   	pop    %ebx
80105457:	5e                   	pop    %esi
80105458:	5d                   	pop    %ebp
80105459:	c3                   	ret    
8010545a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    return -1;
80105460:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105465:	eb ec                	jmp    80105453 <sys_fstat+0x53>
80105467:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010546e:	66 90                	xchg   %ax,%ax

80105470 <sys_link>:
{
80105470:	55                   	push   %ebp
80105471:	89 e5                	mov    %esp,%ebp
80105473:	57                   	push   %edi
80105474:	56                   	push   %esi
  if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
80105475:	8d 45 d4             	lea    -0x2c(%ebp),%eax
{
80105478:	53                   	push   %ebx
80105479:	83 ec 34             	sub    $0x34,%esp
  if(argstr(0, &old) < 0 || argstr(1, &new) < 0)
8010547c:	50                   	push   %eax
8010547d:	6a 00                	push   $0x0
8010547f:	e8 0c fb ff ff       	call   80104f90 <argstr>
80105484:	83 c4 10             	add    $0x10,%esp
80105487:	85 c0                	test   %eax,%eax
80105489:	0f 88 fb 00 00 00    	js     8010558a <sys_link+0x11a>
8010548f:	83 ec 08             	sub    $0x8,%esp
80105492:	8d 45 d0             	lea    -0x30(%ebp),%eax
80105495:	50                   	push   %eax
80105496:	6a 01                	push   $0x1
80105498:	e8 f3 fa ff ff       	call   80104f90 <argstr>
8010549d:	83 c4 10             	add    $0x10,%esp
801054a0:	85 c0                	test   %eax,%eax
801054a2:	0f 88 e2 00 00 00    	js     8010558a <sys_link+0x11a>
  begin_op();
801054a8:	e8 d3 d8 ff ff       	call   80102d80 <begin_op>
  if((ip = namei(old)) == 0){
801054ad:	83 ec 0c             	sub    $0xc,%esp
801054b0:	ff 75 d4             	push   -0x2c(%ebp)
801054b3:	e8 08 cc ff ff       	call   801020c0 <namei>
801054b8:	83 c4 10             	add    $0x10,%esp
801054bb:	89 c3                	mov    %eax,%ebx
801054bd:	85 c0                	test   %eax,%eax
801054bf:	0f 84 e4 00 00 00    	je     801055a9 <sys_link+0x139>
  ilock(ip);
801054c5:	83 ec 0c             	sub    $0xc,%esp
801054c8:	50                   	push   %eax
801054c9:	e8 d2 c2 ff ff       	call   801017a0 <ilock>
  if(ip->type == T_DIR){
801054ce:	83 c4 10             	add    $0x10,%esp
801054d1:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
801054d6:	0f 84 b5 00 00 00    	je     80105591 <sys_link+0x121>
  iupdate(ip);
801054dc:	83 ec 0c             	sub    $0xc,%esp
  ip->nlink++;
801054df:	66 83 43 56 01       	addw   $0x1,0x56(%ebx)
  if((dp = nameiparent(new, name)) == 0)
801054e4:	8d 7d da             	lea    -0x26(%ebp),%edi
  iupdate(ip);
801054e7:	53                   	push   %ebx
801054e8:	e8 03 c2 ff ff       	call   801016f0 <iupdate>
  iunlock(ip);
801054ed:	89 1c 24             	mov    %ebx,(%esp)
801054f0:	e8 8b c3 ff ff       	call   80101880 <iunlock>
  if((dp = nameiparent(new, name)) == 0)
801054f5:	58                   	pop    %eax
801054f6:	5a                   	pop    %edx
801054f7:	57                   	push   %edi
801054f8:	ff 75 d0             	push   -0x30(%ebp)
801054fb:	e8 e0 cb ff ff       	call   801020e0 <nameiparent>
80105500:	83 c4 10             	add    $0x10,%esp
80105503:	89 c6                	mov    %eax,%esi
80105505:	85 c0                	test   %eax,%eax
80105507:	74 5b                	je     80105564 <sys_link+0xf4>
  ilock(dp);
80105509:	83 ec 0c             	sub    $0xc,%esp
8010550c:	50                   	push   %eax
8010550d:	e8 8e c2 ff ff       	call   801017a0 <ilock>
  if(dp->dev != ip->dev || dirlink(dp, name, ip->inum) < 0){
80105512:	8b 03                	mov    (%ebx),%eax
80105514:	83 c4 10             	add    $0x10,%esp
80105517:	39 06                	cmp    %eax,(%esi)
80105519:	75 3d                	jne    80105558 <sys_link+0xe8>
8010551b:	83 ec 04             	sub    $0x4,%esp
8010551e:	ff 73 04             	push   0x4(%ebx)
80105521:	57                   	push   %edi
80105522:	56                   	push   %esi
80105523:	e8 d8 ca ff ff       	call   80102000 <dirlink>
80105528:	83 c4 10             	add    $0x10,%esp
8010552b:	85 c0                	test   %eax,%eax
8010552d:	78 29                	js     80105558 <sys_link+0xe8>
  iunlockput(dp);
8010552f:	83 ec 0c             	sub    $0xc,%esp
80105532:	56                   	push   %esi
80105533:	e8 f8 c4 ff ff       	call   80101a30 <iunlockput>
  iput(ip);
80105538:	89 1c 24             	mov    %ebx,(%esp)
8010553b:	e8 90 c3 ff ff       	call   801018d0 <iput>
  end_op();
80105540:	e8 ab d8 ff ff       	call   80102df0 <end_op>
  return 0;
80105545:	83 c4 10             	add    $0x10,%esp
80105548:	31 c0                	xor    %eax,%eax
}
8010554a:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010554d:	5b                   	pop    %ebx
8010554e:	5e                   	pop    %esi
8010554f:	5f                   	pop    %edi
80105550:	5d                   	pop    %ebp
80105551:	c3                   	ret    
80105552:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    iunlockput(dp);
80105558:	83 ec 0c             	sub    $0xc,%esp
8010555b:	56                   	push   %esi
8010555c:	e8 cf c4 ff ff       	call   80101a30 <iunlockput>
    goto bad;
80105561:	83 c4 10             	add    $0x10,%esp
  ilock(ip);
80105564:	83 ec 0c             	sub    $0xc,%esp
80105567:	53                   	push   %ebx
80105568:	e8 33 c2 ff ff       	call   801017a0 <ilock>
  ip->nlink--;
8010556d:	66 83 6b 56 01       	subw   $0x1,0x56(%ebx)
  iupdate(ip);
80105572:	89 1c 24             	mov    %ebx,(%esp)
80105575:	e8 76 c1 ff ff       	call   801016f0 <iupdate>
  iunlockput(ip);
8010557a:	89 1c 24             	mov    %ebx,(%esp)
8010557d:	e8 ae c4 ff ff       	call   80101a30 <iunlockput>
  end_op();
80105582:	e8 69 d8 ff ff       	call   80102df0 <end_op>
  return -1;
80105587:	83 c4 10             	add    $0x10,%esp
8010558a:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010558f:	eb b9                	jmp    8010554a <sys_link+0xda>
    iunlockput(ip);
80105591:	83 ec 0c             	sub    $0xc,%esp
80105594:	53                   	push   %ebx
80105595:	e8 96 c4 ff ff       	call   80101a30 <iunlockput>
    end_op();
8010559a:	e8 51 d8 ff ff       	call   80102df0 <end_op>
    return -1;
8010559f:	83 c4 10             	add    $0x10,%esp
801055a2:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
801055a7:	eb a1                	jmp    8010554a <sys_link+0xda>
    end_op();
801055a9:	e8 42 d8 ff ff       	call   80102df0 <end_op>
    return -1;
801055ae:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
801055b3:	eb 95                	jmp    8010554a <sys_link+0xda>
801055b5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801055bc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801055c0 <sys_unlink>:
{
801055c0:	55                   	push   %ebp
801055c1:	89 e5                	mov    %esp,%ebp
801055c3:	57                   	push   %edi
801055c4:	56                   	push   %esi
  if(argstr(0, &path) < 0)
801055c5:	8d 45 c0             	lea    -0x40(%ebp),%eax
{
801055c8:	53                   	push   %ebx
801055c9:	83 ec 54             	sub    $0x54,%esp
  if(argstr(0, &path) < 0)
801055cc:	50                   	push   %eax
801055cd:	6a 00                	push   $0x0
801055cf:	e8 bc f9 ff ff       	call   80104f90 <argstr>
801055d4:	83 c4 10             	add    $0x10,%esp
801055d7:	85 c0                	test   %eax,%eax
801055d9:	0f 88 7a 01 00 00    	js     80105759 <sys_unlink+0x199>
  begin_op();
801055df:	e8 9c d7 ff ff       	call   80102d80 <begin_op>
  if((dp = nameiparent(path, name)) == 0){
801055e4:	8d 5d ca             	lea    -0x36(%ebp),%ebx
801055e7:	83 ec 08             	sub    $0x8,%esp
801055ea:	53                   	push   %ebx
801055eb:	ff 75 c0             	push   -0x40(%ebp)
801055ee:	e8 ed ca ff ff       	call   801020e0 <nameiparent>
801055f3:	83 c4 10             	add    $0x10,%esp
801055f6:	89 45 b4             	mov    %eax,-0x4c(%ebp)
801055f9:	85 c0                	test   %eax,%eax
801055fb:	0f 84 62 01 00 00    	je     80105763 <sys_unlink+0x1a3>
  ilock(dp);
80105601:	8b 7d b4             	mov    -0x4c(%ebp),%edi
80105604:	83 ec 0c             	sub    $0xc,%esp
80105607:	57                   	push   %edi
80105608:	e8 93 c1 ff ff       	call   801017a0 <ilock>
  if(namecmp(name, ".") == 0 || namecmp(name, "..") == 0)
8010560d:	58                   	pop    %eax
8010560e:	5a                   	pop    %edx
8010560f:	68 d4 80 10 80       	push   $0x801080d4
80105614:	53                   	push   %ebx
80105615:	e8 c6 c6 ff ff       	call   80101ce0 <namecmp>
8010561a:	83 c4 10             	add    $0x10,%esp
8010561d:	85 c0                	test   %eax,%eax
8010561f:	0f 84 fb 00 00 00    	je     80105720 <sys_unlink+0x160>
80105625:	83 ec 08             	sub    $0x8,%esp
80105628:	68 d3 80 10 80       	push   $0x801080d3
8010562d:	53                   	push   %ebx
8010562e:	e8 ad c6 ff ff       	call   80101ce0 <namecmp>
80105633:	83 c4 10             	add    $0x10,%esp
80105636:	85 c0                	test   %eax,%eax
80105638:	0f 84 e2 00 00 00    	je     80105720 <sys_unlink+0x160>
  if((ip = dirlookup(dp, name, &off)) == 0)
8010563e:	83 ec 04             	sub    $0x4,%esp
80105641:	8d 45 c4             	lea    -0x3c(%ebp),%eax
80105644:	50                   	push   %eax
80105645:	53                   	push   %ebx
80105646:	57                   	push   %edi
80105647:	e8 b4 c6 ff ff       	call   80101d00 <dirlookup>
8010564c:	83 c4 10             	add    $0x10,%esp
8010564f:	89 c3                	mov    %eax,%ebx
80105651:	85 c0                	test   %eax,%eax
80105653:	0f 84 c7 00 00 00    	je     80105720 <sys_unlink+0x160>
  ilock(ip);
80105659:	83 ec 0c             	sub    $0xc,%esp
8010565c:	50                   	push   %eax
8010565d:	e8 3e c1 ff ff       	call   801017a0 <ilock>
  if(ip->nlink < 1)
80105662:	83 c4 10             	add    $0x10,%esp
80105665:	66 83 7b 56 00       	cmpw   $0x0,0x56(%ebx)
8010566a:	0f 8e 1c 01 00 00    	jle    8010578c <sys_unlink+0x1cc>
  if(ip->type == T_DIR && !isdirempty(ip)){
80105670:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105675:	8d 7d d8             	lea    -0x28(%ebp),%edi
80105678:	74 66                	je     801056e0 <sys_unlink+0x120>
  memset(&de, 0, sizeof(de));
8010567a:	83 ec 04             	sub    $0x4,%esp
8010567d:	6a 10                	push   $0x10
8010567f:	6a 00                	push   $0x0
80105681:	57                   	push   %edi
80105682:	e8 89 f5 ff ff       	call   80104c10 <memset>
  if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
80105687:	6a 10                	push   $0x10
80105689:	ff 75 c4             	push   -0x3c(%ebp)
8010568c:	57                   	push   %edi
8010568d:	ff 75 b4             	push   -0x4c(%ebp)
80105690:	e8 1b c5 ff ff       	call   80101bb0 <writei>
80105695:	83 c4 20             	add    $0x20,%esp
80105698:	83 f8 10             	cmp    $0x10,%eax
8010569b:	0f 85 de 00 00 00    	jne    8010577f <sys_unlink+0x1bf>
  if(ip->type == T_DIR){
801056a1:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
801056a6:	0f 84 94 00 00 00    	je     80105740 <sys_unlink+0x180>
  iunlockput(dp);
801056ac:	83 ec 0c             	sub    $0xc,%esp
801056af:	ff 75 b4             	push   -0x4c(%ebp)
801056b2:	e8 79 c3 ff ff       	call   80101a30 <iunlockput>
  ip->nlink--;
801056b7:	66 83 6b 56 01       	subw   $0x1,0x56(%ebx)
  iupdate(ip);
801056bc:	89 1c 24             	mov    %ebx,(%esp)
801056bf:	e8 2c c0 ff ff       	call   801016f0 <iupdate>
  iunlockput(ip);
801056c4:	89 1c 24             	mov    %ebx,(%esp)
801056c7:	e8 64 c3 ff ff       	call   80101a30 <iunlockput>
  end_op();
801056cc:	e8 1f d7 ff ff       	call   80102df0 <end_op>
  return 0;
801056d1:	83 c4 10             	add    $0x10,%esp
801056d4:	31 c0                	xor    %eax,%eax
}
801056d6:	8d 65 f4             	lea    -0xc(%ebp),%esp
801056d9:	5b                   	pop    %ebx
801056da:	5e                   	pop    %esi
801056db:	5f                   	pop    %edi
801056dc:	5d                   	pop    %ebp
801056dd:	c3                   	ret    
801056de:	66 90                	xchg   %ax,%ax
  for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
801056e0:	83 7b 58 20          	cmpl   $0x20,0x58(%ebx)
801056e4:	76 94                	jbe    8010567a <sys_unlink+0xba>
801056e6:	be 20 00 00 00       	mov    $0x20,%esi
801056eb:	eb 0b                	jmp    801056f8 <sys_unlink+0x138>
801056ed:	8d 76 00             	lea    0x0(%esi),%esi
801056f0:	83 c6 10             	add    $0x10,%esi
801056f3:	3b 73 58             	cmp    0x58(%ebx),%esi
801056f6:	73 82                	jae    8010567a <sys_unlink+0xba>
    if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
801056f8:	6a 10                	push   $0x10
801056fa:	56                   	push   %esi
801056fb:	57                   	push   %edi
801056fc:	53                   	push   %ebx
801056fd:	e8 ae c3 ff ff       	call   80101ab0 <readi>
80105702:	83 c4 10             	add    $0x10,%esp
80105705:	83 f8 10             	cmp    $0x10,%eax
80105708:	75 68                	jne    80105772 <sys_unlink+0x1b2>
    if(de.inum != 0)
8010570a:	66 83 7d d8 00       	cmpw   $0x0,-0x28(%ebp)
8010570f:	74 df                	je     801056f0 <sys_unlink+0x130>
    iunlockput(ip);
80105711:	83 ec 0c             	sub    $0xc,%esp
80105714:	53                   	push   %ebx
80105715:	e8 16 c3 ff ff       	call   80101a30 <iunlockput>
    goto bad;
8010571a:	83 c4 10             	add    $0x10,%esp
8010571d:	8d 76 00             	lea    0x0(%esi),%esi
  iunlockput(dp);
80105720:	83 ec 0c             	sub    $0xc,%esp
80105723:	ff 75 b4             	push   -0x4c(%ebp)
80105726:	e8 05 c3 ff ff       	call   80101a30 <iunlockput>
  end_op();
8010572b:	e8 c0 d6 ff ff       	call   80102df0 <end_op>
  return -1;
80105730:	83 c4 10             	add    $0x10,%esp
80105733:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105738:	eb 9c                	jmp    801056d6 <sys_unlink+0x116>
8010573a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    dp->nlink--;
80105740:	8b 45 b4             	mov    -0x4c(%ebp),%eax
    iupdate(dp);
80105743:	83 ec 0c             	sub    $0xc,%esp
    dp->nlink--;
80105746:	66 83 68 56 01       	subw   $0x1,0x56(%eax)
    iupdate(dp);
8010574b:	50                   	push   %eax
8010574c:	e8 9f bf ff ff       	call   801016f0 <iupdate>
80105751:	83 c4 10             	add    $0x10,%esp
80105754:	e9 53 ff ff ff       	jmp    801056ac <sys_unlink+0xec>
    return -1;
80105759:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010575e:	e9 73 ff ff ff       	jmp    801056d6 <sys_unlink+0x116>
    end_op();
80105763:	e8 88 d6 ff ff       	call   80102df0 <end_op>
    return -1;
80105768:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
8010576d:	e9 64 ff ff ff       	jmp    801056d6 <sys_unlink+0x116>
      panic("isdirempty: readi");
80105772:	83 ec 0c             	sub    $0xc,%esp
80105775:	68 f8 80 10 80       	push   $0x801080f8
8010577a:	e8 01 ac ff ff       	call   80100380 <panic>
    panic("unlink: writei");
8010577f:	83 ec 0c             	sub    $0xc,%esp
80105782:	68 0a 81 10 80       	push   $0x8010810a
80105787:	e8 f4 ab ff ff       	call   80100380 <panic>
    panic("unlink: nlink < 1");
8010578c:	83 ec 0c             	sub    $0xc,%esp
8010578f:	68 e6 80 10 80       	push   $0x801080e6
80105794:	e8 e7 ab ff ff       	call   80100380 <panic>
80105799:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

801057a0 <sys_open>:

int
sys_open(void)
{
801057a0:	55                   	push   %ebp
801057a1:	89 e5                	mov    %esp,%ebp
801057a3:	57                   	push   %edi
801057a4:	56                   	push   %esi
  char *path;
  int fd, omode;
  struct file *f;
  struct inode *ip;

  if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801057a5:	8d 45 e0             	lea    -0x20(%ebp),%eax
{
801057a8:	53                   	push   %ebx
801057a9:	83 ec 24             	sub    $0x24,%esp
  if(argstr(0, &path) < 0 || argint(1, &omode) < 0)
801057ac:	50                   	push   %eax
801057ad:	6a 00                	push   $0x0
801057af:	e8 dc f7 ff ff       	call   80104f90 <argstr>
801057b4:	83 c4 10             	add    $0x10,%esp
801057b7:	85 c0                	test   %eax,%eax
801057b9:	0f 88 8e 00 00 00    	js     8010584d <sys_open+0xad>
801057bf:	83 ec 08             	sub    $0x8,%esp
801057c2:	8d 45 e4             	lea    -0x1c(%ebp),%eax
801057c5:	50                   	push   %eax
801057c6:	6a 01                	push   $0x1
801057c8:	e8 03 f7 ff ff       	call   80104ed0 <argint>
801057cd:	83 c4 10             	add    $0x10,%esp
801057d0:	85 c0                	test   %eax,%eax
801057d2:	78 79                	js     8010584d <sys_open+0xad>
    return -1;

  begin_op();
801057d4:	e8 a7 d5 ff ff       	call   80102d80 <begin_op>

  if(omode & O_CREATE){
801057d9:	f6 45 e5 02          	testb  $0x2,-0x1b(%ebp)
801057dd:	75 79                	jne    80105858 <sys_open+0xb8>
    if(ip == 0){
      end_op();
      return -1;
    }
  } else {
    if((ip = namei(path)) == 0){
801057df:	83 ec 0c             	sub    $0xc,%esp
801057e2:	ff 75 e0             	push   -0x20(%ebp)
801057e5:	e8 d6 c8 ff ff       	call   801020c0 <namei>
801057ea:	83 c4 10             	add    $0x10,%esp
801057ed:	89 c6                	mov    %eax,%esi
801057ef:	85 c0                	test   %eax,%eax
801057f1:	0f 84 7e 00 00 00    	je     80105875 <sys_open+0xd5>
      end_op();
      return -1;
    }
    ilock(ip);
801057f7:	83 ec 0c             	sub    $0xc,%esp
801057fa:	50                   	push   %eax
801057fb:	e8 a0 bf ff ff       	call   801017a0 <ilock>
    if(ip->type == T_DIR && omode != O_RDONLY){
80105800:	83 c4 10             	add    $0x10,%esp
80105803:	66 83 7e 50 01       	cmpw   $0x1,0x50(%esi)
80105808:	0f 84 c2 00 00 00    	je     801058d0 <sys_open+0x130>
      end_op();
      return -1;
    }
  }

  if((f = filealloc()) == 0 || (fd = fdalloc(f)) < 0){
8010580e:	e8 1d b6 ff ff       	call   80100e30 <filealloc>
80105813:	89 c7                	mov    %eax,%edi
80105815:	85 c0                	test   %eax,%eax
80105817:	74 23                	je     8010583c <sys_open+0x9c>
  struct proc *curproc = myproc();
80105819:	e8 82 e1 ff ff       	call   801039a0 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
8010581e:	31 db                	xor    %ebx,%ebx
    if(curproc->ofile[fd] == 0){
80105820:	8b 54 98 28          	mov    0x28(%eax,%ebx,4),%edx
80105824:	85 d2                	test   %edx,%edx
80105826:	74 60                	je     80105888 <sys_open+0xe8>
  for(fd = 0; fd < NOFILE; fd++){
80105828:	83 c3 01             	add    $0x1,%ebx
8010582b:	83 fb 10             	cmp    $0x10,%ebx
8010582e:	75 f0                	jne    80105820 <sys_open+0x80>
    if(f)
      fileclose(f);
80105830:	83 ec 0c             	sub    $0xc,%esp
80105833:	57                   	push   %edi
80105834:	e8 b7 b6 ff ff       	call   80100ef0 <fileclose>
80105839:	83 c4 10             	add    $0x10,%esp
    iunlockput(ip);
8010583c:	83 ec 0c             	sub    $0xc,%esp
8010583f:	56                   	push   %esi
80105840:	e8 eb c1 ff ff       	call   80101a30 <iunlockput>
    end_op();
80105845:	e8 a6 d5 ff ff       	call   80102df0 <end_op>
    return -1;
8010584a:	83 c4 10             	add    $0x10,%esp
8010584d:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80105852:	eb 6d                	jmp    801058c1 <sys_open+0x121>
80105854:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    ip = create(path, T_FILE, 0, 0);
80105858:	83 ec 0c             	sub    $0xc,%esp
8010585b:	8b 45 e0             	mov    -0x20(%ebp),%eax
8010585e:	31 c9                	xor    %ecx,%ecx
80105860:	ba 02 00 00 00       	mov    $0x2,%edx
80105865:	6a 00                	push   $0x0
80105867:	e8 14 f8 ff ff       	call   80105080 <create>
    if(ip == 0){
8010586c:	83 c4 10             	add    $0x10,%esp
    ip = create(path, T_FILE, 0, 0);
8010586f:	89 c6                	mov    %eax,%esi
    if(ip == 0){
80105871:	85 c0                	test   %eax,%eax
80105873:	75 99                	jne    8010580e <sys_open+0x6e>
      end_op();
80105875:	e8 76 d5 ff ff       	call   80102df0 <end_op>
      return -1;
8010587a:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
8010587f:	eb 40                	jmp    801058c1 <sys_open+0x121>
80105881:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  }
  iunlock(ip);
80105888:	83 ec 0c             	sub    $0xc,%esp
      curproc->ofile[fd] = f;
8010588b:	89 7c 98 28          	mov    %edi,0x28(%eax,%ebx,4)
  iunlock(ip);
8010588f:	56                   	push   %esi
80105890:	e8 eb bf ff ff       	call   80101880 <iunlock>
  end_op();
80105895:	e8 56 d5 ff ff       	call   80102df0 <end_op>

  f->type = FD_INODE;
8010589a:	c7 07 02 00 00 00    	movl   $0x2,(%edi)
  f->ip = ip;
  f->off = 0;
  f->readable = !(omode & O_WRONLY);
801058a0:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
801058a3:	83 c4 10             	add    $0x10,%esp
  f->ip = ip;
801058a6:	89 77 10             	mov    %esi,0x10(%edi)
  f->readable = !(omode & O_WRONLY);
801058a9:	89 d0                	mov    %edx,%eax
  f->off = 0;
801058ab:	c7 47 14 00 00 00 00 	movl   $0x0,0x14(%edi)
  f->readable = !(omode & O_WRONLY);
801058b2:	f7 d0                	not    %eax
801058b4:	83 e0 01             	and    $0x1,%eax
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
801058b7:	83 e2 03             	and    $0x3,%edx
  f->readable = !(omode & O_WRONLY);
801058ba:	88 47 08             	mov    %al,0x8(%edi)
  f->writable = (omode & O_WRONLY) || (omode & O_RDWR);
801058bd:	0f 95 47 09          	setne  0x9(%edi)
  return fd;
}
801058c1:	8d 65 f4             	lea    -0xc(%ebp),%esp
801058c4:	89 d8                	mov    %ebx,%eax
801058c6:	5b                   	pop    %ebx
801058c7:	5e                   	pop    %esi
801058c8:	5f                   	pop    %edi
801058c9:	5d                   	pop    %ebp
801058ca:	c3                   	ret    
801058cb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801058cf:	90                   	nop
    if(ip->type == T_DIR && omode != O_RDONLY){
801058d0:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
801058d3:	85 c9                	test   %ecx,%ecx
801058d5:	0f 84 33 ff ff ff    	je     8010580e <sys_open+0x6e>
801058db:	e9 5c ff ff ff       	jmp    8010583c <sys_open+0x9c>

801058e0 <sys_mkdir>:

int
sys_mkdir(void)
{
801058e0:	55                   	push   %ebp
801058e1:	89 e5                	mov    %esp,%ebp
801058e3:	83 ec 18             	sub    $0x18,%esp
  char *path;
  struct inode *ip;

  begin_op();
801058e6:	e8 95 d4 ff ff       	call   80102d80 <begin_op>
  if(argstr(0, &path) < 0 || (ip = create(path, T_DIR, 0, 0)) == 0){
801058eb:	83 ec 08             	sub    $0x8,%esp
801058ee:	8d 45 f4             	lea    -0xc(%ebp),%eax
801058f1:	50                   	push   %eax
801058f2:	6a 00                	push   $0x0
801058f4:	e8 97 f6 ff ff       	call   80104f90 <argstr>
801058f9:	83 c4 10             	add    $0x10,%esp
801058fc:	85 c0                	test   %eax,%eax
801058fe:	78 30                	js     80105930 <sys_mkdir+0x50>
80105900:	83 ec 0c             	sub    $0xc,%esp
80105903:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105906:	31 c9                	xor    %ecx,%ecx
80105908:	ba 01 00 00 00       	mov    $0x1,%edx
8010590d:	6a 00                	push   $0x0
8010590f:	e8 6c f7 ff ff       	call   80105080 <create>
80105914:	83 c4 10             	add    $0x10,%esp
80105917:	85 c0                	test   %eax,%eax
80105919:	74 15                	je     80105930 <sys_mkdir+0x50>
    end_op();
    return -1;
  }
  iunlockput(ip);
8010591b:	83 ec 0c             	sub    $0xc,%esp
8010591e:	50                   	push   %eax
8010591f:	e8 0c c1 ff ff       	call   80101a30 <iunlockput>
  end_op();
80105924:	e8 c7 d4 ff ff       	call   80102df0 <end_op>
  return 0;
80105929:	83 c4 10             	add    $0x10,%esp
8010592c:	31 c0                	xor    %eax,%eax
}
8010592e:	c9                   	leave  
8010592f:	c3                   	ret    
    end_op();
80105930:	e8 bb d4 ff ff       	call   80102df0 <end_op>
    return -1;
80105935:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
8010593a:	c9                   	leave  
8010593b:	c3                   	ret    
8010593c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105940 <sys_mknod>:

int
sys_mknod(void)
{
80105940:	55                   	push   %ebp
80105941:	89 e5                	mov    %esp,%ebp
80105943:	83 ec 18             	sub    $0x18,%esp
  struct inode *ip;
  char *path;
  int major, minor;

  begin_op();
80105946:	e8 35 d4 ff ff       	call   80102d80 <begin_op>
  if((argstr(0, &path)) < 0 ||
8010594b:	83 ec 08             	sub    $0x8,%esp
8010594e:	8d 45 ec             	lea    -0x14(%ebp),%eax
80105951:	50                   	push   %eax
80105952:	6a 00                	push   $0x0
80105954:	e8 37 f6 ff ff       	call   80104f90 <argstr>
80105959:	83 c4 10             	add    $0x10,%esp
8010595c:	85 c0                	test   %eax,%eax
8010595e:	78 60                	js     801059c0 <sys_mknod+0x80>
     argint(1, &major) < 0 ||
80105960:	83 ec 08             	sub    $0x8,%esp
80105963:	8d 45 f0             	lea    -0x10(%ebp),%eax
80105966:	50                   	push   %eax
80105967:	6a 01                	push   $0x1
80105969:	e8 62 f5 ff ff       	call   80104ed0 <argint>
  if((argstr(0, &path)) < 0 ||
8010596e:	83 c4 10             	add    $0x10,%esp
80105971:	85 c0                	test   %eax,%eax
80105973:	78 4b                	js     801059c0 <sys_mknod+0x80>
     argint(2, &minor) < 0 ||
80105975:	83 ec 08             	sub    $0x8,%esp
80105978:	8d 45 f4             	lea    -0xc(%ebp),%eax
8010597b:	50                   	push   %eax
8010597c:	6a 02                	push   $0x2
8010597e:	e8 4d f5 ff ff       	call   80104ed0 <argint>
     argint(1, &major) < 0 ||
80105983:	83 c4 10             	add    $0x10,%esp
80105986:	85 c0                	test   %eax,%eax
80105988:	78 36                	js     801059c0 <sys_mknod+0x80>
     (ip = create(path, T_DEV, major, minor)) == 0){
8010598a:	0f bf 45 f4          	movswl -0xc(%ebp),%eax
8010598e:	83 ec 0c             	sub    $0xc,%esp
80105991:	0f bf 4d f0          	movswl -0x10(%ebp),%ecx
80105995:	ba 03 00 00 00       	mov    $0x3,%edx
8010599a:	50                   	push   %eax
8010599b:	8b 45 ec             	mov    -0x14(%ebp),%eax
8010599e:	e8 dd f6 ff ff       	call   80105080 <create>
     argint(2, &minor) < 0 ||
801059a3:	83 c4 10             	add    $0x10,%esp
801059a6:	85 c0                	test   %eax,%eax
801059a8:	74 16                	je     801059c0 <sys_mknod+0x80>
    end_op();
    return -1;
  }
  iunlockput(ip);
801059aa:	83 ec 0c             	sub    $0xc,%esp
801059ad:	50                   	push   %eax
801059ae:	e8 7d c0 ff ff       	call   80101a30 <iunlockput>
  end_op();
801059b3:	e8 38 d4 ff ff       	call   80102df0 <end_op>
  return 0;
801059b8:	83 c4 10             	add    $0x10,%esp
801059bb:	31 c0                	xor    %eax,%eax
}
801059bd:	c9                   	leave  
801059be:	c3                   	ret    
801059bf:	90                   	nop
    end_op();
801059c0:	e8 2b d4 ff ff       	call   80102df0 <end_op>
    return -1;
801059c5:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801059ca:	c9                   	leave  
801059cb:	c3                   	ret    
801059cc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

801059d0 <sys_chdir>:

int
sys_chdir(void)
{
801059d0:	55                   	push   %ebp
801059d1:	89 e5                	mov    %esp,%ebp
801059d3:	56                   	push   %esi
801059d4:	53                   	push   %ebx
801059d5:	83 ec 10             	sub    $0x10,%esp
  char *path;
  struct inode *ip;
  struct proc *curproc = myproc();
801059d8:	e8 c3 df ff ff       	call   801039a0 <myproc>
801059dd:	89 c6                	mov    %eax,%esi
  
  begin_op();
801059df:	e8 9c d3 ff ff       	call   80102d80 <begin_op>
  if(argstr(0, &path) < 0 || (ip = namei(path)) == 0){
801059e4:	83 ec 08             	sub    $0x8,%esp
801059e7:	8d 45 f4             	lea    -0xc(%ebp),%eax
801059ea:	50                   	push   %eax
801059eb:	6a 00                	push   $0x0
801059ed:	e8 9e f5 ff ff       	call   80104f90 <argstr>
801059f2:	83 c4 10             	add    $0x10,%esp
801059f5:	85 c0                	test   %eax,%eax
801059f7:	78 77                	js     80105a70 <sys_chdir+0xa0>
801059f9:	83 ec 0c             	sub    $0xc,%esp
801059fc:	ff 75 f4             	push   -0xc(%ebp)
801059ff:	e8 bc c6 ff ff       	call   801020c0 <namei>
80105a04:	83 c4 10             	add    $0x10,%esp
80105a07:	89 c3                	mov    %eax,%ebx
80105a09:	85 c0                	test   %eax,%eax
80105a0b:	74 63                	je     80105a70 <sys_chdir+0xa0>
    end_op();
    return -1;
  }
  ilock(ip);
80105a0d:	83 ec 0c             	sub    $0xc,%esp
80105a10:	50                   	push   %eax
80105a11:	e8 8a bd ff ff       	call   801017a0 <ilock>
  if(ip->type != T_DIR){
80105a16:	83 c4 10             	add    $0x10,%esp
80105a19:	66 83 7b 50 01       	cmpw   $0x1,0x50(%ebx)
80105a1e:	75 30                	jne    80105a50 <sys_chdir+0x80>
    iunlockput(ip);
    end_op();
    return -1;
  }
  iunlock(ip);
80105a20:	83 ec 0c             	sub    $0xc,%esp
80105a23:	53                   	push   %ebx
80105a24:	e8 57 be ff ff       	call   80101880 <iunlock>
  iput(curproc->cwd);
80105a29:	58                   	pop    %eax
80105a2a:	ff 76 68             	push   0x68(%esi)
80105a2d:	e8 9e be ff ff       	call   801018d0 <iput>
  end_op();
80105a32:	e8 b9 d3 ff ff       	call   80102df0 <end_op>
  curproc->cwd = ip;
80105a37:	89 5e 68             	mov    %ebx,0x68(%esi)
  return 0;
80105a3a:	83 c4 10             	add    $0x10,%esp
80105a3d:	31 c0                	xor    %eax,%eax
}
80105a3f:	8d 65 f8             	lea    -0x8(%ebp),%esp
80105a42:	5b                   	pop    %ebx
80105a43:	5e                   	pop    %esi
80105a44:	5d                   	pop    %ebp
80105a45:	c3                   	ret    
80105a46:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105a4d:	8d 76 00             	lea    0x0(%esi),%esi
    iunlockput(ip);
80105a50:	83 ec 0c             	sub    $0xc,%esp
80105a53:	53                   	push   %ebx
80105a54:	e8 d7 bf ff ff       	call   80101a30 <iunlockput>
    end_op();
80105a59:	e8 92 d3 ff ff       	call   80102df0 <end_op>
    return -1;
80105a5e:	83 c4 10             	add    $0x10,%esp
80105a61:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105a66:	eb d7                	jmp    80105a3f <sys_chdir+0x6f>
80105a68:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105a6f:	90                   	nop
    end_op();
80105a70:	e8 7b d3 ff ff       	call   80102df0 <end_op>
    return -1;
80105a75:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105a7a:	eb c3                	jmp    80105a3f <sys_chdir+0x6f>
80105a7c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105a80 <sys_exec>:

int
sys_exec(void)
{
80105a80:	55                   	push   %ebp
80105a81:	89 e5                	mov    %esp,%ebp
80105a83:	57                   	push   %edi
80105a84:	56                   	push   %esi
  char *path, *argv[MAXARG];
  int i;
  uint uargv, uarg;

  if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80105a85:	8d 85 5c ff ff ff    	lea    -0xa4(%ebp),%eax
{
80105a8b:	53                   	push   %ebx
80105a8c:	81 ec a4 00 00 00    	sub    $0xa4,%esp
  if(argstr(0, &path) < 0 || argint(1, (int*)&uargv) < 0){
80105a92:	50                   	push   %eax
80105a93:	6a 00                	push   $0x0
80105a95:	e8 f6 f4 ff ff       	call   80104f90 <argstr>
80105a9a:	83 c4 10             	add    $0x10,%esp
80105a9d:	85 c0                	test   %eax,%eax
80105a9f:	0f 88 87 00 00 00    	js     80105b2c <sys_exec+0xac>
80105aa5:	83 ec 08             	sub    $0x8,%esp
80105aa8:	8d 85 60 ff ff ff    	lea    -0xa0(%ebp),%eax
80105aae:	50                   	push   %eax
80105aaf:	6a 01                	push   $0x1
80105ab1:	e8 1a f4 ff ff       	call   80104ed0 <argint>
80105ab6:	83 c4 10             	add    $0x10,%esp
80105ab9:	85 c0                	test   %eax,%eax
80105abb:	78 6f                	js     80105b2c <sys_exec+0xac>
    return -1;
  }
  memset(argv, 0, sizeof(argv));
80105abd:	83 ec 04             	sub    $0x4,%esp
80105ac0:	8d b5 68 ff ff ff    	lea    -0x98(%ebp),%esi
  for(i=0;; i++){
80105ac6:	31 db                	xor    %ebx,%ebx
  memset(argv, 0, sizeof(argv));
80105ac8:	68 80 00 00 00       	push   $0x80
80105acd:	6a 00                	push   $0x0
80105acf:	56                   	push   %esi
80105ad0:	e8 3b f1 ff ff       	call   80104c10 <memset>
80105ad5:	83 c4 10             	add    $0x10,%esp
80105ad8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105adf:	90                   	nop
    if(i >= NELEM(argv))
      return -1;
    if(fetchint(uargv+4*i, (int*)&uarg) < 0)
80105ae0:	83 ec 08             	sub    $0x8,%esp
80105ae3:	8d 85 64 ff ff ff    	lea    -0x9c(%ebp),%eax
80105ae9:	8d 3c 9d 00 00 00 00 	lea    0x0(,%ebx,4),%edi
80105af0:	50                   	push   %eax
80105af1:	8b 85 60 ff ff ff    	mov    -0xa0(%ebp),%eax
80105af7:	01 f8                	add    %edi,%eax
80105af9:	50                   	push   %eax
80105afa:	e8 41 f3 ff ff       	call   80104e40 <fetchint>
80105aff:	83 c4 10             	add    $0x10,%esp
80105b02:	85 c0                	test   %eax,%eax
80105b04:	78 26                	js     80105b2c <sys_exec+0xac>
      return -1;
    if(uarg == 0){
80105b06:	8b 85 64 ff ff ff    	mov    -0x9c(%ebp),%eax
80105b0c:	85 c0                	test   %eax,%eax
80105b0e:	74 30                	je     80105b40 <sys_exec+0xc0>
      argv[i] = 0;
      break;
    }
    if(fetchstr(uarg, &argv[i]) < 0)
80105b10:	83 ec 08             	sub    $0x8,%esp
80105b13:	8d 14 3e             	lea    (%esi,%edi,1),%edx
80105b16:	52                   	push   %edx
80105b17:	50                   	push   %eax
80105b18:	e8 63 f3 ff ff       	call   80104e80 <fetchstr>
80105b1d:	83 c4 10             	add    $0x10,%esp
80105b20:	85 c0                	test   %eax,%eax
80105b22:	78 08                	js     80105b2c <sys_exec+0xac>
  for(i=0;; i++){
80105b24:	83 c3 01             	add    $0x1,%ebx
    if(i >= NELEM(argv))
80105b27:	83 fb 20             	cmp    $0x20,%ebx
80105b2a:	75 b4                	jne    80105ae0 <sys_exec+0x60>
      return -1;
  }
  return exec(path, argv);
}
80105b2c:	8d 65 f4             	lea    -0xc(%ebp),%esp
    return -1;
80105b2f:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105b34:	5b                   	pop    %ebx
80105b35:	5e                   	pop    %esi
80105b36:	5f                   	pop    %edi
80105b37:	5d                   	pop    %ebp
80105b38:	c3                   	ret    
80105b39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
      argv[i] = 0;
80105b40:	c7 84 9d 68 ff ff ff 	movl   $0x0,-0x98(%ebp,%ebx,4)
80105b47:	00 00 00 00 
  return exec(path, argv);
80105b4b:	83 ec 08             	sub    $0x8,%esp
80105b4e:	56                   	push   %esi
80105b4f:	ff b5 5c ff ff ff    	push   -0xa4(%ebp)
80105b55:	e8 56 af ff ff       	call   80100ab0 <exec>
80105b5a:	83 c4 10             	add    $0x10,%esp
}
80105b5d:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105b60:	5b                   	pop    %ebx
80105b61:	5e                   	pop    %esi
80105b62:	5f                   	pop    %edi
80105b63:	5d                   	pop    %ebp
80105b64:	c3                   	ret    
80105b65:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105b6c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105b70 <sys_pipe>:

int
sys_pipe(void)
{
80105b70:	55                   	push   %ebp
80105b71:	89 e5                	mov    %esp,%ebp
80105b73:	57                   	push   %edi
80105b74:	56                   	push   %esi
  int *fd;
  struct file *rf, *wf;
  int fd0, fd1;

  if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105b75:	8d 45 dc             	lea    -0x24(%ebp),%eax
{
80105b78:	53                   	push   %ebx
80105b79:	83 ec 20             	sub    $0x20,%esp
  if(argptr(0, (void*)&fd, 2*sizeof(fd[0])) < 0)
80105b7c:	6a 08                	push   $0x8
80105b7e:	50                   	push   %eax
80105b7f:	6a 00                	push   $0x0
80105b81:	e8 9a f3 ff ff       	call   80104f20 <argptr>
80105b86:	83 c4 10             	add    $0x10,%esp
80105b89:	85 c0                	test   %eax,%eax
80105b8b:	78 4a                	js     80105bd7 <sys_pipe+0x67>
    return -1;
  if(pipealloc(&rf, &wf) < 0)
80105b8d:	83 ec 08             	sub    $0x8,%esp
80105b90:	8d 45 e4             	lea    -0x1c(%ebp),%eax
80105b93:	50                   	push   %eax
80105b94:	8d 45 e0             	lea    -0x20(%ebp),%eax
80105b97:	50                   	push   %eax
80105b98:	e8 b3 d8 ff ff       	call   80103450 <pipealloc>
80105b9d:	83 c4 10             	add    $0x10,%esp
80105ba0:	85 c0                	test   %eax,%eax
80105ba2:	78 33                	js     80105bd7 <sys_pipe+0x67>
    return -1;
  fd0 = -1;
  if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105ba4:	8b 7d e0             	mov    -0x20(%ebp),%edi
  for(fd = 0; fd < NOFILE; fd++){
80105ba7:	31 db                	xor    %ebx,%ebx
  struct proc *curproc = myproc();
80105ba9:	e8 f2 dd ff ff       	call   801039a0 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80105bae:	66 90                	xchg   %ax,%ax
    if(curproc->ofile[fd] == 0){
80105bb0:	8b 74 98 28          	mov    0x28(%eax,%ebx,4),%esi
80105bb4:	85 f6                	test   %esi,%esi
80105bb6:	74 28                	je     80105be0 <sys_pipe+0x70>
  for(fd = 0; fd < NOFILE; fd++){
80105bb8:	83 c3 01             	add    $0x1,%ebx
80105bbb:	83 fb 10             	cmp    $0x10,%ebx
80105bbe:	75 f0                	jne    80105bb0 <sys_pipe+0x40>
    if(fd0 >= 0)
      myproc()->ofile[fd0] = 0;
    fileclose(rf);
80105bc0:	83 ec 0c             	sub    $0xc,%esp
80105bc3:	ff 75 e0             	push   -0x20(%ebp)
80105bc6:	e8 25 b3 ff ff       	call   80100ef0 <fileclose>
    fileclose(wf);
80105bcb:	58                   	pop    %eax
80105bcc:	ff 75 e4             	push   -0x1c(%ebp)
80105bcf:	e8 1c b3 ff ff       	call   80100ef0 <fileclose>
    return -1;
80105bd4:	83 c4 10             	add    $0x10,%esp
80105bd7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105bdc:	eb 53                	jmp    80105c31 <sys_pipe+0xc1>
80105bde:	66 90                	xchg   %ax,%ax
      curproc->ofile[fd] = f;
80105be0:	8d 73 08             	lea    0x8(%ebx),%esi
80105be3:	89 7c b0 08          	mov    %edi,0x8(%eax,%esi,4)
  if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
80105be7:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  struct proc *curproc = myproc();
80105bea:	e8 b1 dd ff ff       	call   801039a0 <myproc>
  for(fd = 0; fd < NOFILE; fd++){
80105bef:	31 d2                	xor    %edx,%edx
80105bf1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    if(curproc->ofile[fd] == 0){
80105bf8:	8b 4c 90 28          	mov    0x28(%eax,%edx,4),%ecx
80105bfc:	85 c9                	test   %ecx,%ecx
80105bfe:	74 20                	je     80105c20 <sys_pipe+0xb0>
  for(fd = 0; fd < NOFILE; fd++){
80105c00:	83 c2 01             	add    $0x1,%edx
80105c03:	83 fa 10             	cmp    $0x10,%edx
80105c06:	75 f0                	jne    80105bf8 <sys_pipe+0x88>
      myproc()->ofile[fd0] = 0;
80105c08:	e8 93 dd ff ff       	call   801039a0 <myproc>
80105c0d:	c7 44 b0 08 00 00 00 	movl   $0x0,0x8(%eax,%esi,4)
80105c14:	00 
80105c15:	eb a9                	jmp    80105bc0 <sys_pipe+0x50>
80105c17:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105c1e:	66 90                	xchg   %ax,%ax
      curproc->ofile[fd] = f;
80105c20:	89 7c 90 28          	mov    %edi,0x28(%eax,%edx,4)
  }
  fd[0] = fd0;
80105c24:	8b 45 dc             	mov    -0x24(%ebp),%eax
80105c27:	89 18                	mov    %ebx,(%eax)
  fd[1] = fd1;
80105c29:	8b 45 dc             	mov    -0x24(%ebp),%eax
80105c2c:	89 50 04             	mov    %edx,0x4(%eax)
  return 0;
80105c2f:	31 c0                	xor    %eax,%eax
}
80105c31:	8d 65 f4             	lea    -0xc(%ebp),%esp
80105c34:	5b                   	pop    %ebx
80105c35:	5e                   	pop    %esi
80105c36:	5f                   	pop    %edi
80105c37:	5d                   	pop    %ebp
80105c38:	c3                   	ret    
80105c39:	66 90                	xchg   %ax,%ax
80105c3b:	66 90                	xchg   %ax,%ax
80105c3d:	66 90                	xchg   %ax,%ax
80105c3f:	90                   	nop

80105c40 <sys_fork>:
#include "proc.h"

int
sys_fork(void)
{
  return fork();
80105c40:	e9 fb de ff ff       	jmp    80103b40 <fork>
80105c45:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105c4c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105c50 <sys_set_quantum>:
}

int sys_set_quantum(void){
80105c50:	55                   	push   %ebp
80105c51:	89 e5                	mov    %esp,%ebp
80105c53:	83 ec 20             	sub    $0x20,%esp
  int a;
  if(argint(0, &a) < 0){
80105c56:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105c59:	50                   	push   %eax
80105c5a:	6a 00                	push   $0x0
80105c5c:	e8 6f f2 ff ff       	call   80104ed0 <argint>
80105c61:	83 c4 10             	add    $0x10,%esp
80105c64:	85 c0                	test   %eax,%eax
80105c66:	78 18                	js     80105c80 <sys_set_quantum+0x30>
    return -1;
  }
  struct proc *curproc = myproc();
80105c68:	e8 33 dd ff ff       	call   801039a0 <myproc>
  curproc->quantum = a;
80105c6d:	8b 55 f4             	mov    -0xc(%ebp),%edx
80105c70:	89 50 7c             	mov    %edx,0x7c(%eax)
  return 0;
80105c73:	31 c0                	xor    %eax,%eax
}
80105c75:	c9                   	leave  
80105c76:	c3                   	ret    
80105c77:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105c7e:	66 90                	xchg   %ax,%ax
80105c80:	c9                   	leave  
    return -1;
80105c81:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105c86:	c3                   	ret    
80105c87:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105c8e:	66 90                	xchg   %ax,%ax

80105c90 <sys_exit>:

int
sys_exit(void)
{
80105c90:	55                   	push   %ebp
80105c91:	89 e5                	mov    %esp,%ebp
80105c93:	83 ec 08             	sub    $0x8,%esp
  exit();
80105c96:	e8 b5 e2 ff ff       	call   80103f50 <exit>
  return 0;  // not reached
}
80105c9b:	31 c0                	xor    %eax,%eax
80105c9d:	c9                   	leave  
80105c9e:	c3                   	ret    
80105c9f:	90                   	nop

80105ca0 <sys_wait>:

int
sys_wait(void)
{
  return wait();
80105ca0:	e9 db e3 ff ff       	jmp    80104080 <wait>
80105ca5:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105cac:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80105cb0 <sys_kill>:
}

int
sys_kill(void)
{
80105cb0:	55                   	push   %ebp
80105cb1:	89 e5                	mov    %esp,%ebp
80105cb3:	83 ec 20             	sub    $0x20,%esp
  int pid;

  if(argint(0, &pid) < 0)
80105cb6:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105cb9:	50                   	push   %eax
80105cba:	6a 00                	push   $0x0
80105cbc:	e8 0f f2 ff ff       	call   80104ed0 <argint>
80105cc1:	83 c4 10             	add    $0x10,%esp
80105cc4:	85 c0                	test   %eax,%eax
80105cc6:	78 18                	js     80105ce0 <sys_kill+0x30>
    return -1;
  return kill(pid);
80105cc8:	83 ec 0c             	sub    $0xc,%esp
80105ccb:	ff 75 f4             	push   -0xc(%ebp)
80105cce:	e8 4d e6 ff ff       	call   80104320 <kill>
80105cd3:	83 c4 10             	add    $0x10,%esp
}
80105cd6:	c9                   	leave  
80105cd7:	c3                   	ret    
80105cd8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105cdf:	90                   	nop
80105ce0:	c9                   	leave  
    return -1;
80105ce1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105ce6:	c3                   	ret    
80105ce7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105cee:	66 90                	xchg   %ax,%ax

80105cf0 <sys_getpid>:

int
sys_getpid(void)
{
80105cf0:	55                   	push   %ebp
80105cf1:	89 e5                	mov    %esp,%ebp
80105cf3:	83 ec 08             	sub    $0x8,%esp
  return myproc()->pid;
80105cf6:	e8 a5 dc ff ff       	call   801039a0 <myproc>
80105cfb:	8b 40 10             	mov    0x10(%eax),%eax
}
80105cfe:	c9                   	leave  
80105cff:	c3                   	ret    

80105d00 <sys_sbrk>:

int
sys_sbrk(void)
{
80105d00:	55                   	push   %ebp
80105d01:	89 e5                	mov    %esp,%ebp
80105d03:	53                   	push   %ebx
  int addr;
  int n;

  if(argint(0, &n) < 0)
80105d04:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
80105d07:	83 ec 1c             	sub    $0x1c,%esp
  if(argint(0, &n) < 0)
80105d0a:	50                   	push   %eax
80105d0b:	6a 00                	push   $0x0
80105d0d:	e8 be f1 ff ff       	call   80104ed0 <argint>
80105d12:	83 c4 10             	add    $0x10,%esp
80105d15:	85 c0                	test   %eax,%eax
80105d17:	78 27                	js     80105d40 <sys_sbrk+0x40>
    return -1;
  addr = myproc()->sz;
80105d19:	e8 82 dc ff ff       	call   801039a0 <myproc>
  if(growproc(n) < 0)
80105d1e:	83 ec 0c             	sub    $0xc,%esp
  addr = myproc()->sz;
80105d21:	8b 18                	mov    (%eax),%ebx
  if(growproc(n) < 0)
80105d23:	ff 75 f4             	push   -0xc(%ebp)
80105d26:	e8 95 dd ff ff       	call   80103ac0 <growproc>
80105d2b:	83 c4 10             	add    $0x10,%esp
80105d2e:	85 c0                	test   %eax,%eax
80105d30:	78 0e                	js     80105d40 <sys_sbrk+0x40>
    return -1;
  return addr;
}
80105d32:	89 d8                	mov    %ebx,%eax
80105d34:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105d37:	c9                   	leave  
80105d38:	c3                   	ret    
80105d39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    return -1;
80105d40:	bb ff ff ff ff       	mov    $0xffffffff,%ebx
80105d45:	eb eb                	jmp    80105d32 <sys_sbrk+0x32>
80105d47:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105d4e:	66 90                	xchg   %ax,%ax

80105d50 <sys_sleep>:

int
sys_sleep(void)
{
80105d50:	55                   	push   %ebp
80105d51:	89 e5                	mov    %esp,%ebp
80105d53:	53                   	push   %ebx
  int n;
  uint ticks0;

  if(argint(0, &n) < 0)
80105d54:	8d 45 f4             	lea    -0xc(%ebp),%eax
{
80105d57:	83 ec 1c             	sub    $0x1c,%esp
  if(argint(0, &n) < 0)
80105d5a:	50                   	push   %eax
80105d5b:	6a 00                	push   $0x0
80105d5d:	e8 6e f1 ff ff       	call   80104ed0 <argint>
80105d62:	83 c4 10             	add    $0x10,%esp
80105d65:	85 c0                	test   %eax,%eax
80105d67:	0f 88 8a 00 00 00    	js     80105df7 <sys_sleep+0xa7>
    return -1;
  acquire(&tickslock);
80105d6d:	83 ec 0c             	sub    $0xc,%esp
80105d70:	68 80 ce 11 80       	push   $0x8011ce80
80105d75:	e8 26 ed ff ff       	call   80104aa0 <acquire>
  ticks0 = ticks;
  while(ticks - ticks0 < n){
80105d7a:	8b 55 f4             	mov    -0xc(%ebp),%edx
  ticks0 = ticks;
80105d7d:	8b 1d 60 ce 11 80    	mov    0x8011ce60,%ebx
  while(ticks - ticks0 < n){
80105d83:	83 c4 10             	add    $0x10,%esp
80105d86:	85 d2                	test   %edx,%edx
80105d88:	75 27                	jne    80105db1 <sys_sleep+0x61>
80105d8a:	eb 54                	jmp    80105de0 <sys_sleep+0x90>
80105d8c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(myproc()->killed){
      release(&tickslock);
      return -1;
    }
    sleep(&ticks, &tickslock);
80105d90:	83 ec 08             	sub    $0x8,%esp
80105d93:	68 80 ce 11 80       	push   $0x8011ce80
80105d98:	68 60 ce 11 80       	push   $0x8011ce60
80105d9d:	e8 5e e4 ff ff       	call   80104200 <sleep>
  while(ticks - ticks0 < n){
80105da2:	a1 60 ce 11 80       	mov    0x8011ce60,%eax
80105da7:	83 c4 10             	add    $0x10,%esp
80105daa:	29 d8                	sub    %ebx,%eax
80105dac:	3b 45 f4             	cmp    -0xc(%ebp),%eax
80105daf:	73 2f                	jae    80105de0 <sys_sleep+0x90>
    if(myproc()->killed){
80105db1:	e8 ea db ff ff       	call   801039a0 <myproc>
80105db6:	8b 40 24             	mov    0x24(%eax),%eax
80105db9:	85 c0                	test   %eax,%eax
80105dbb:	74 d3                	je     80105d90 <sys_sleep+0x40>
      release(&tickslock);
80105dbd:	83 ec 0c             	sub    $0xc,%esp
80105dc0:	68 80 ce 11 80       	push   $0x8011ce80
80105dc5:	e8 f6 ed ff ff       	call   80104bc0 <release>
  }
  release(&tickslock);
  return 0;
}
80105dca:	8b 5d fc             	mov    -0x4(%ebp),%ebx
      return -1;
80105dcd:	83 c4 10             	add    $0x10,%esp
80105dd0:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105dd5:	c9                   	leave  
80105dd6:	c3                   	ret    
80105dd7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105dde:	66 90                	xchg   %ax,%ax
  release(&tickslock);
80105de0:	83 ec 0c             	sub    $0xc,%esp
80105de3:	68 80 ce 11 80       	push   $0x8011ce80
80105de8:	e8 d3 ed ff ff       	call   80104bc0 <release>
  return 0;
80105ded:	83 c4 10             	add    $0x10,%esp
80105df0:	31 c0                	xor    %eax,%eax
}
80105df2:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105df5:	c9                   	leave  
80105df6:	c3                   	ret    
    return -1;
80105df7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105dfc:	eb f4                	jmp    80105df2 <sys_sleep+0xa2>
80105dfe:	66 90                	xchg   %ax,%ax

80105e00 <sys_uptime>:

// return how many clock tick interrupts have occurred
// since start.
int
sys_uptime(void)
{
80105e00:	55                   	push   %ebp
80105e01:	89 e5                	mov    %esp,%ebp
80105e03:	53                   	push   %ebx
80105e04:	83 ec 10             	sub    $0x10,%esp
  uint xticks;

  acquire(&tickslock);
80105e07:	68 80 ce 11 80       	push   $0x8011ce80
80105e0c:	e8 8f ec ff ff       	call   80104aa0 <acquire>
  xticks = ticks;
80105e11:	8b 1d 60 ce 11 80    	mov    0x8011ce60,%ebx
  release(&tickslock);
80105e17:	c7 04 24 80 ce 11 80 	movl   $0x8011ce80,(%esp)
80105e1e:	e8 9d ed ff ff       	call   80104bc0 <release>
  return xticks;
}
80105e23:	89 d8                	mov    %ebx,%eax
80105e25:	8b 5d fc             	mov    -0x4(%ebp),%ebx
80105e28:	c9                   	leave  
80105e29:	c3                   	ret    
80105e2a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80105e30 <sys_shutdown>:
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80105e30:	b8 00 20 00 00       	mov    $0x2000,%eax
80105e35:	ba 04 06 00 00       	mov    $0x604,%edx
80105e3a:	66 ef                	out    %ax,(%dx)

int
sys_shutdown(void){
  outw(0x604, 0x2000);
  return 0;
}
80105e3c:	31 c0                	xor    %eax,%eax
80105e3e:	c3                   	ret    
80105e3f:	90                   	nop

80105e40 <sys_enable_sched_display>:


extern int display_enabled;
int sys_enable_sched_display(void){
80105e40:	55                   	push   %ebp
80105e41:	89 e5                	mov    %esp,%ebp
80105e43:	83 ec 20             	sub    $0x20,%esp
	int i;
	if(argint(0,&i)<0)
80105e46:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105e49:	50                   	push   %eax
80105e4a:	6a 00                	push   $0x0
80105e4c:	e8 7f f0 ff ff       	call   80104ed0 <argint>
80105e51:	83 c4 10             	add    $0x10,%esp
80105e54:	85 c0                	test   %eax,%eax
80105e56:	78 0c                	js     80105e64 <sys_enable_sched_display+0x24>
		return -1;
	display_enabled=i;
80105e58:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105e5b:	a3 20 2d 11 80       	mov    %eax,0x80112d20
	return 0;
80105e60:	31 c0                	xor    %eax,%eax
}
80105e62:	c9                   	leave  
80105e63:	c3                   	ret    
80105e64:	c9                   	leave  
		return -1;
80105e65:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105e6a:	c3                   	ret    
80105e6b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80105e6f:	90                   	nop

80105e70 <sys_set_priority>:

extern int set_priority(int,int);

int sys_set_priority(void){
80105e70:	55                   	push   %ebp
80105e71:	89 e5                	mov    %esp,%ebp
80105e73:	83 ec 20             	sub    $0x20,%esp
  int pid;
  int prior;
  if(argint(0,&pid) < 0){
80105e76:	8d 45 f0             	lea    -0x10(%ebp),%eax
80105e79:	50                   	push   %eax
80105e7a:	6a 00                	push   $0x0
80105e7c:	e8 4f f0 ff ff       	call   80104ed0 <argint>
80105e81:	83 c4 10             	add    $0x10,%esp
80105e84:	85 c0                	test   %eax,%eax
80105e86:	78 28                	js     80105eb0 <sys_set_priority+0x40>
    return -1;
  }
  if(argint(1,&prior) < 0){
80105e88:	83 ec 08             	sub    $0x8,%esp
80105e8b:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105e8e:	50                   	push   %eax
80105e8f:	6a 01                	push   $0x1
80105e91:	e8 3a f0 ff ff       	call   80104ed0 <argint>
80105e96:	83 c4 10             	add    $0x10,%esp
80105e99:	85 c0                	test   %eax,%eax
80105e9b:	78 13                	js     80105eb0 <sys_set_priority+0x40>
    return -1;
  }
  return set_priority(pid, prior);
80105e9d:	83 ec 08             	sub    $0x8,%esp
80105ea0:	ff 75 f4             	push   -0xc(%ebp)
80105ea3:	ff 75 f0             	push   -0x10(%ebp)
80105ea6:	e8 d5 dd ff ff       	call   80103c80 <set_priority>
80105eab:	83 c4 10             	add    $0x10,%esp
}
80105eae:	c9                   	leave  
80105eaf:	c3                   	ret    
80105eb0:	c9                   	leave  
    return -1;
80105eb1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105eb6:	c3                   	ret    
80105eb7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105ebe:	66 90                	xchg   %ax,%ax

80105ec0 <sys_alloc_sem>:
extern int alloc_sem(int);
extern int wait_sem(int);
extern int signal_sem(int);
extern int dealloc_sem(int);

int sys_alloc_sem (void){
80105ec0:	55                   	push   %ebp
80105ec1:	89 e5                	mov    %esp,%ebp
80105ec3:	83 ec 20             	sub    $0x20,%esp
  int i;
	argint(0,&i);
80105ec6:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105ec9:	50                   	push   %eax
80105eca:	6a 00                	push   $0x0
80105ecc:	e8 ff ef ff ff       	call   80104ed0 <argint>
	if(i<0) return -1;
80105ed1:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105ed4:	83 c4 10             	add    $0x10,%esp
80105ed7:	85 c0                	test   %eax,%eax
80105ed9:	78 15                	js     80105ef0 <sys_alloc_sem+0x30>
	return alloc_sem(i);
80105edb:	83 ec 0c             	sub    $0xc,%esp
80105ede:	50                   	push   %eax
80105edf:	e8 0c e5 ff ff       	call   801043f0 <alloc_sem>
80105ee4:	83 c4 10             	add    $0x10,%esp
}
80105ee7:	c9                   	leave  
80105ee8:	c3                   	ret    
80105ee9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105ef0:	c9                   	leave  
	if(i<0) return -1;
80105ef1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105ef6:	c3                   	ret    
80105ef7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105efe:	66 90                	xchg   %ax,%ax

80105f00 <sys_wait_sem>:

int sys_wait_sem(void){
80105f00:	55                   	push   %ebp
80105f01:	89 e5                	mov    %esp,%ebp
80105f03:	83 ec 20             	sub    $0x20,%esp
	int i;
	argint(0,&i);
80105f06:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105f09:	50                   	push   %eax
80105f0a:	6a 00                	push   $0x0
80105f0c:	e8 bf ef ff ff       	call   80104ed0 <argint>
	if(i<0||i>=100)
80105f11:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105f14:	83 c4 10             	add    $0x10,%esp
80105f17:	83 f8 63             	cmp    $0x63,%eax
80105f1a:	77 14                	ja     80105f30 <sys_wait_sem+0x30>
		return -1;
	return wait_sem(i);
80105f1c:	83 ec 0c             	sub    $0xc,%esp
80105f1f:	50                   	push   %eax
80105f20:	e8 6b e5 ff ff       	call   80104490 <wait_sem>
80105f25:	83 c4 10             	add    $0x10,%esp
}
80105f28:	c9                   	leave  
80105f29:	c3                   	ret    
80105f2a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80105f30:	c9                   	leave  
		return -1;
80105f31:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105f36:	c3                   	ret    
80105f37:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105f3e:	66 90                	xchg   %ax,%ax

80105f40 <sys_signal_sem>:

int sys_signal_sem(void){
80105f40:	55                   	push   %ebp
80105f41:	89 e5                	mov    %esp,%ebp
80105f43:	83 ec 20             	sub    $0x20,%esp
	int i;
	argint(0,&i);
80105f46:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105f49:	50                   	push   %eax
80105f4a:	6a 00                	push   $0x0
80105f4c:	e8 7f ef ff ff       	call   80104ed0 <argint>
	if(i<0||i>=100)
80105f51:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105f54:	83 c4 10             	add    $0x10,%esp
80105f57:	83 f8 63             	cmp    $0x63,%eax
80105f5a:	77 14                	ja     80105f70 <sys_signal_sem+0x30>
		return -1;
	return signal_sem(i);
80105f5c:	83 ec 0c             	sub    $0xc,%esp
80105f5f:	50                   	push   %eax
80105f60:	e8 8b e6 ff ff       	call   801045f0 <signal_sem>
80105f65:	83 c4 10             	add    $0x10,%esp
}
80105f68:	c9                   	leave  
80105f69:	c3                   	ret    
80105f6a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80105f70:	c9                   	leave  
		return -1;
80105f71:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80105f76:	c3                   	ret    
80105f77:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105f7e:	66 90                	xchg   %ax,%ax

80105f80 <sys_dealloc_sem>:

int sys_dealloc_sem(void){
80105f80:	55                   	push   %ebp
80105f81:	89 e5                	mov    %esp,%ebp
80105f83:	83 ec 20             	sub    $0x20,%esp
	int i;
	argint(0,&i);
80105f86:	8d 45 f4             	lea    -0xc(%ebp),%eax
80105f89:	50                   	push   %eax
80105f8a:	6a 00                	push   $0x0
80105f8c:	e8 3f ef ff ff       	call   80104ed0 <argint>
	if(i<0||i>=100)
80105f91:	8b 45 f4             	mov    -0xc(%ebp),%eax
80105f94:	83 c4 10             	add    $0x10,%esp
80105f97:	83 f8 63             	cmp    $0x63,%eax
80105f9a:	77 14                	ja     80105fb0 <sys_dealloc_sem+0x30>
		return -1;
	return dealloc_sem(i);
80105f9c:	83 ec 0c             	sub    $0xc,%esp
80105f9f:	50                   	push   %eax
80105fa0:	e8 3b e7 ff ff       	call   801046e0 <dealloc_sem>
80105fa5:	83 c4 10             	add    $0x10,%esp
80105fa8:	c9                   	leave  
80105fa9:	c3                   	ret    
80105faa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
80105fb0:	c9                   	leave  
		return -1;
80105fb1:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
80105fb6:	c3                   	ret    

80105fb7 <alltraps>:

  # vectors.S sends all traps here.
.globl alltraps
alltraps:
  # Build trap frame.
  pushl %ds
80105fb7:	1e                   	push   %ds
  pushl %es
80105fb8:	06                   	push   %es
  pushl %fs
80105fb9:	0f a0                	push   %fs
  pushl %gs
80105fbb:	0f a8                	push   %gs
  pushal
80105fbd:	60                   	pusha  
  
  # Set up data segments.
  movw $(SEG_KDATA<<3), %ax
80105fbe:	66 b8 10 00          	mov    $0x10,%ax
  movw %ax, %ds
80105fc2:	8e d8                	mov    %eax,%ds
  movw %ax, %es
80105fc4:	8e c0                	mov    %eax,%es

  # Call trap(tf), where tf=%esp
  pushl %esp
80105fc6:	54                   	push   %esp
  call trap
80105fc7:	e8 c4 00 00 00       	call   80106090 <trap>
  addl $4, %esp
80105fcc:	83 c4 04             	add    $0x4,%esp

80105fcf <trapret>:

  # Return falls through to trapret...
.globl trapret
trapret:
  popal
80105fcf:	61                   	popa   
  popl %gs
80105fd0:	0f a9                	pop    %gs
  popl %fs
80105fd2:	0f a1                	pop    %fs
  popl %es
80105fd4:	07                   	pop    %es
  popl %ds
80105fd5:	1f                   	pop    %ds
  addl $0x8, %esp  # trapno and errcode
80105fd6:	83 c4 08             	add    $0x8,%esp
  iret
80105fd9:	cf                   	iret   
80105fda:	66 90                	xchg   %ax,%ax
80105fdc:	66 90                	xchg   %ax,%ax
80105fde:	66 90                	xchg   %ax,%ax

80105fe0 <tvinit>:
struct spinlock tickslock;
uint ticks;

void
tvinit(void)
{
80105fe0:	55                   	push   %ebp
  int i;

  for(i = 0; i < 256; i++)
80105fe1:	31 c0                	xor    %eax,%eax
{
80105fe3:	89 e5                	mov    %esp,%ebp
80105fe5:	83 ec 08             	sub    $0x8,%esp
80105fe8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80105fef:	90                   	nop
    SETGATE(idt[i], 0, SEG_KCODE<<3, vectors[i], 0);
80105ff0:	8b 14 85 08 b0 10 80 	mov    -0x7fef4ff8(,%eax,4),%edx
80105ff7:	c7 04 c5 c2 ce 11 80 	movl   $0x8e000008,-0x7fee313e(,%eax,8)
80105ffe:	08 00 00 8e 
80106002:	66 89 14 c5 c0 ce 11 	mov    %dx,-0x7fee3140(,%eax,8)
80106009:	80 
8010600a:	c1 ea 10             	shr    $0x10,%edx
8010600d:	66 89 14 c5 c6 ce 11 	mov    %dx,-0x7fee313a(,%eax,8)
80106014:	80 
  for(i = 0; i < 256; i++)
80106015:	83 c0 01             	add    $0x1,%eax
80106018:	3d 00 01 00 00       	cmp    $0x100,%eax
8010601d:	75 d1                	jne    80105ff0 <tvinit+0x10>
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);

  initlock(&tickslock, "time");
8010601f:	83 ec 08             	sub    $0x8,%esp
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
80106022:	a1 08 b1 10 80       	mov    0x8010b108,%eax
80106027:	c7 05 c2 d0 11 80 08 	movl   $0xef000008,0x8011d0c2
8010602e:	00 00 ef 
  initlock(&tickslock, "time");
80106031:	68 19 81 10 80       	push   $0x80108119
80106036:	68 80 ce 11 80       	push   $0x8011ce80
  SETGATE(idt[T_SYSCALL], 1, SEG_KCODE<<3, vectors[T_SYSCALL], DPL_USER);
8010603b:	66 a3 c0 d0 11 80    	mov    %ax,0x8011d0c0
80106041:	c1 e8 10             	shr    $0x10,%eax
80106044:	66 a3 c6 d0 11 80    	mov    %ax,0x8011d0c6
  initlock(&tickslock, "time");
8010604a:	e8 41 e9 ff ff       	call   80104990 <initlock>
}
8010604f:	83 c4 10             	add    $0x10,%esp
80106052:	c9                   	leave  
80106053:	c3                   	ret    
80106054:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010605b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010605f:	90                   	nop

80106060 <idtinit>:

void
idtinit(void)
{
80106060:	55                   	push   %ebp
  pd[0] = size-1;
80106061:	b8 ff 07 00 00       	mov    $0x7ff,%eax
80106066:	89 e5                	mov    %esp,%ebp
80106068:	83 ec 10             	sub    $0x10,%esp
8010606b:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
  pd[1] = (uint)p;
8010606f:	b8 c0 ce 11 80       	mov    $0x8011cec0,%eax
80106074:	66 89 45 fc          	mov    %ax,-0x4(%ebp)
  pd[2] = (uint)p >> 16;
80106078:	c1 e8 10             	shr    $0x10,%eax
8010607b:	66 89 45 fe          	mov    %ax,-0x2(%ebp)
  asm volatile("lidt (%0)" : : "r" (pd));
8010607f:	8d 45 fa             	lea    -0x6(%ebp),%eax
80106082:	0f 01 18             	lidtl  (%eax)
  lidt(idt, sizeof(idt));
}
80106085:	c9                   	leave  
80106086:	c3                   	ret    
80106087:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010608e:	66 90                	xchg   %ax,%ax

80106090 <trap>:

//PAGEBREAK: 41
void
trap(struct trapframe *tf)
{
80106090:	55                   	push   %ebp
80106091:	89 e5                	mov    %esp,%ebp
80106093:	57                   	push   %edi
80106094:	56                   	push   %esi
80106095:	53                   	push   %ebx
80106096:	83 ec 1c             	sub    $0x1c,%esp
80106099:	8b 5d 08             	mov    0x8(%ebp),%ebx
  if(tf->trapno == T_SYSCALL){
8010609c:	8b 43 30             	mov    0x30(%ebx),%eax
8010609f:	83 f8 40             	cmp    $0x40,%eax
801060a2:	0f 84 a0 01 00 00    	je     80106248 <trap+0x1b8>
    if(myproc()->killed)
      exit();
    return;
  }

  switch(tf->trapno){
801060a8:	83 e8 20             	sub    $0x20,%eax
801060ab:	83 f8 1f             	cmp    $0x1f,%eax
801060ae:	0f 87 8c 00 00 00    	ja     80106140 <trap+0xb0>
801060b4:	ff 24 85 c0 81 10 80 	jmp    *-0x7fef7e40(,%eax,4)
801060bb:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
801060bf:	90                   	nop
      release(&tickslock);
    }
    lapiceoi();
    break;
  case T_IRQ0 + IRQ_IDE:
    ideintr();
801060c0:	e8 9b c1 ff ff       	call   80102260 <ideintr>
    lapiceoi();
801060c5:	e8 66 c8 ff ff       	call   80102930 <lapiceoi>
  }

  // Force process exit if it has been killed and is in user space.
  // (If it is still executing in the kernel, let it keep running
  // until it gets to the regular system call return.)
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801060ca:	e8 d1 d8 ff ff       	call   801039a0 <myproc>
801060cf:	85 c0                	test   %eax,%eax
801060d1:	74 1d                	je     801060f0 <trap+0x60>
801060d3:	e8 c8 d8 ff ff       	call   801039a0 <myproc>
801060d8:	8b 50 24             	mov    0x24(%eax),%edx
801060db:	85 d2                	test   %edx,%edx
801060dd:	74 11                	je     801060f0 <trap+0x60>
801060df:	0f b7 43 3c          	movzwl 0x3c(%ebx),%eax
801060e3:	83 e0 03             	and    $0x3,%eax
801060e6:	66 83 f8 03          	cmp    $0x3,%ax
801060ea:	0f 84 20 02 00 00    	je     80106310 <trap+0x280>
    exit();

  // 时间片调度
  // Force process to give up CPU on clock tick.
  // If interrupts were on while locks held, would need to check nlock.
  if(myproc() && myproc()->state == RUNNING &&
801060f0:	e8 ab d8 ff ff       	call   801039a0 <myproc>
801060f5:	85 c0                	test   %eax,%eax
801060f7:	74 0f                	je     80106108 <trap+0x78>
801060f9:	e8 a2 d8 ff ff       	call   801039a0 <myproc>
801060fe:	83 78 0c 04          	cmpl   $0x4,0xc(%eax)
80106102:	0f 84 b8 00 00 00    	je     801061c0 <trap+0x130>
    }
    


  // Check if the process has been killed since we yielded
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80106108:	e8 93 d8 ff ff       	call   801039a0 <myproc>
8010610d:	85 c0                	test   %eax,%eax
8010610f:	74 1d                	je     8010612e <trap+0x9e>
80106111:	e8 8a d8 ff ff       	call   801039a0 <myproc>
80106116:	8b 40 24             	mov    0x24(%eax),%eax
80106119:	85 c0                	test   %eax,%eax
8010611b:	74 11                	je     8010612e <trap+0x9e>
8010611d:	0f b7 43 3c          	movzwl 0x3c(%ebx),%eax
80106121:	83 e0 03             	and    $0x3,%eax
80106124:	66 83 f8 03          	cmp    $0x3,%ax
80106128:	0f 84 47 01 00 00    	je     80106275 <trap+0x1e5>
    exit();
}
8010612e:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106131:	5b                   	pop    %ebx
80106132:	5e                   	pop    %esi
80106133:	5f                   	pop    %edi
80106134:	5d                   	pop    %ebp
80106135:	c3                   	ret    
80106136:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010613d:	8d 76 00             	lea    0x0(%esi),%esi
    if(myproc() == 0 || (tf->cs&3) == 0){
80106140:	e8 5b d8 ff ff       	call   801039a0 <myproc>
80106145:	8b 7b 38             	mov    0x38(%ebx),%edi
80106148:	85 c0                	test   %eax,%eax
8010614a:	0f 84 da 01 00 00    	je     8010632a <trap+0x29a>
80106150:	f6 43 3c 03          	testb  $0x3,0x3c(%ebx)
80106154:	0f 84 d0 01 00 00    	je     8010632a <trap+0x29a>

static inline uint
rcr2(void)
{
  uint val;
  asm volatile("movl %%cr2,%0" : "=r" (val));
8010615a:	0f 20 d1             	mov    %cr2,%ecx
8010615d:	89 4d d8             	mov    %ecx,-0x28(%ebp)
    cprintf("pid %d %s: trap %d err %d on cpu %d "
80106160:	e8 1b d8 ff ff       	call   80103980 <cpuid>
80106165:	8b 73 30             	mov    0x30(%ebx),%esi
80106168:	89 45 dc             	mov    %eax,-0x24(%ebp)
8010616b:	8b 43 34             	mov    0x34(%ebx),%eax
8010616e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
            myproc()->pid, myproc()->name, tf->trapno,
80106171:	e8 2a d8 ff ff       	call   801039a0 <myproc>
80106176:	89 45 e0             	mov    %eax,-0x20(%ebp)
80106179:	e8 22 d8 ff ff       	call   801039a0 <myproc>
    cprintf("pid %d %s: trap %d err %d on cpu %d "
8010617e:	8b 4d d8             	mov    -0x28(%ebp),%ecx
80106181:	8b 55 dc             	mov    -0x24(%ebp),%edx
80106184:	51                   	push   %ecx
80106185:	57                   	push   %edi
80106186:	52                   	push   %edx
80106187:	ff 75 e4             	push   -0x1c(%ebp)
8010618a:	56                   	push   %esi
            myproc()->pid, myproc()->name, tf->trapno,
8010618b:	8b 75 e0             	mov    -0x20(%ebp),%esi
8010618e:	83 c6 6c             	add    $0x6c,%esi
    cprintf("pid %d %s: trap %d err %d on cpu %d "
80106191:	56                   	push   %esi
80106192:	ff 70 10             	push   0x10(%eax)
80106195:	68 7c 81 10 80       	push   $0x8010817c
8010619a:	e8 01 a5 ff ff       	call   801006a0 <cprintf>
    myproc()->killed = 1;
8010619f:	83 c4 20             	add    $0x20,%esp
801061a2:	e8 f9 d7 ff ff       	call   801039a0 <myproc>
801061a7:	c7 40 24 01 00 00 00 	movl   $0x1,0x24(%eax)
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801061ae:	e8 ed d7 ff ff       	call   801039a0 <myproc>
801061b3:	85 c0                	test   %eax,%eax
801061b5:	0f 85 18 ff ff ff    	jne    801060d3 <trap+0x43>
801061bb:	e9 30 ff ff ff       	jmp    801060f0 <trap+0x60>
  if(myproc() && myproc()->state == RUNNING &&
801061c0:	83 7b 30 20          	cmpl   $0x20,0x30(%ebx)
801061c4:	0f 85 3e ff ff ff    	jne    80106108 <trap+0x78>
      myproc()->time_elapsed++;
801061ca:	e8 d1 d7 ff ff       	call   801039a0 <myproc>
801061cf:	83 80 80 00 00 00 01 	addl   $0x1,0x80(%eax)
      if(myproc()->time_elapsed >= myproc()->quantum){
801061d6:	e8 c5 d7 ff ff       	call   801039a0 <myproc>
801061db:	8b b0 80 00 00 00    	mov    0x80(%eax),%esi
801061e1:	e8 ba d7 ff ff       	call   801039a0 <myproc>
801061e6:	3b 70 7c             	cmp    0x7c(%eax),%esi
801061e9:	0f 8c 19 ff ff ff    	jl     80106108 <trap+0x78>
        myproc()->time_elapsed=0;
801061ef:	e8 ac d7 ff ff       	call   801039a0 <myproc>
801061f4:	c7 80 80 00 00 00 00 	movl   $0x0,0x80(%eax)
801061fb:	00 00 00 
        yield();
801061fe:	e8 ad df ff ff       	call   801041b0 <yield>
80106203:	e9 00 ff ff ff       	jmp    80106108 <trap+0x78>
80106208:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010620f:	90                   	nop
    cprintf("cpu%d: spurious interrupt at %x:%x\n",
80106210:	8b 7b 38             	mov    0x38(%ebx),%edi
80106213:	0f b7 73 3c          	movzwl 0x3c(%ebx),%esi
80106217:	e8 64 d7 ff ff       	call   80103980 <cpuid>
8010621c:	57                   	push   %edi
8010621d:	56                   	push   %esi
8010621e:	50                   	push   %eax
8010621f:	68 24 81 10 80       	push   $0x80108124
80106224:	e8 77 a4 ff ff       	call   801006a0 <cprintf>
    lapiceoi();
80106229:	e8 02 c7 ff ff       	call   80102930 <lapiceoi>
    break;
8010622e:	83 c4 10             	add    $0x10,%esp
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80106231:	e8 6a d7 ff ff       	call   801039a0 <myproc>
80106236:	85 c0                	test   %eax,%eax
80106238:	0f 85 95 fe ff ff    	jne    801060d3 <trap+0x43>
8010623e:	e9 ad fe ff ff       	jmp    801060f0 <trap+0x60>
80106243:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
80106247:	90                   	nop
    if(myproc()->killed)
80106248:	e8 53 d7 ff ff       	call   801039a0 <myproc>
8010624d:	8b 70 24             	mov    0x24(%eax),%esi
80106250:	85 f6                	test   %esi,%esi
80106252:	0f 85 c8 00 00 00    	jne    80106320 <trap+0x290>
    myproc()->tf = tf;
80106258:	e8 43 d7 ff ff       	call   801039a0 <myproc>
8010625d:	89 58 18             	mov    %ebx,0x18(%eax)
    syscall();
80106260:	e8 ab ed ff ff       	call   80105010 <syscall>
    if(myproc()->killed)
80106265:	e8 36 d7 ff ff       	call   801039a0 <myproc>
8010626a:	8b 48 24             	mov    0x24(%eax),%ecx
8010626d:	85 c9                	test   %ecx,%ecx
8010626f:	0f 84 b9 fe ff ff    	je     8010612e <trap+0x9e>
}
80106275:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106278:	5b                   	pop    %ebx
80106279:	5e                   	pop    %esi
8010627a:	5f                   	pop    %edi
8010627b:	5d                   	pop    %ebp
      exit();
8010627c:	e9 cf dc ff ff       	jmp    80103f50 <exit>
80106281:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    uartintr();
80106288:	e8 43 02 00 00       	call   801064d0 <uartintr>
    lapiceoi();
8010628d:	e8 9e c6 ff ff       	call   80102930 <lapiceoi>
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
80106292:	e8 09 d7 ff ff       	call   801039a0 <myproc>
80106297:	85 c0                	test   %eax,%eax
80106299:	0f 85 34 fe ff ff    	jne    801060d3 <trap+0x43>
8010629f:	e9 4c fe ff ff       	jmp    801060f0 <trap+0x60>
801062a4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    kbdintr();
801062a8:	e8 43 c5 ff ff       	call   801027f0 <kbdintr>
    lapiceoi();
801062ad:	e8 7e c6 ff ff       	call   80102930 <lapiceoi>
  if(myproc() && myproc()->killed && (tf->cs&3) == DPL_USER)
801062b2:	e8 e9 d6 ff ff       	call   801039a0 <myproc>
801062b7:	85 c0                	test   %eax,%eax
801062b9:	0f 85 14 fe ff ff    	jne    801060d3 <trap+0x43>
801062bf:	e9 2c fe ff ff       	jmp    801060f0 <trap+0x60>
801062c4:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    if(cpuid() == 0){
801062c8:	e8 b3 d6 ff ff       	call   80103980 <cpuid>
801062cd:	85 c0                	test   %eax,%eax
801062cf:	0f 85 f0 fd ff ff    	jne    801060c5 <trap+0x35>
      acquire(&tickslock);
801062d5:	83 ec 0c             	sub    $0xc,%esp
801062d8:	68 80 ce 11 80       	push   $0x8011ce80
801062dd:	e8 be e7 ff ff       	call   80104aa0 <acquire>
      wakeup(&ticks);
801062e2:	c7 04 24 60 ce 11 80 	movl   $0x8011ce60,(%esp)
      ticks++;
801062e9:	83 05 60 ce 11 80 01 	addl   $0x1,0x8011ce60
      wakeup(&ticks);
801062f0:	e8 cb df ff ff       	call   801042c0 <wakeup>
      release(&tickslock);
801062f5:	c7 04 24 80 ce 11 80 	movl   $0x8011ce80,(%esp)
801062fc:	e8 bf e8 ff ff       	call   80104bc0 <release>
80106301:	83 c4 10             	add    $0x10,%esp
    lapiceoi();
80106304:	e9 bc fd ff ff       	jmp    801060c5 <trap+0x35>
80106309:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
    exit();
80106310:	e8 3b dc ff ff       	call   80103f50 <exit>
80106315:	e9 d6 fd ff ff       	jmp    801060f0 <trap+0x60>
8010631a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
      exit();
80106320:	e8 2b dc ff ff       	call   80103f50 <exit>
80106325:	e9 2e ff ff ff       	jmp    80106258 <trap+0x1c8>
8010632a:	0f 20 d6             	mov    %cr2,%esi
      cprintf("unexpected trap %d from cpu %d eip %x (cr2=0x%x)\n",
8010632d:	e8 4e d6 ff ff       	call   80103980 <cpuid>
80106332:	83 ec 0c             	sub    $0xc,%esp
80106335:	56                   	push   %esi
80106336:	57                   	push   %edi
80106337:	50                   	push   %eax
80106338:	ff 73 30             	push   0x30(%ebx)
8010633b:	68 48 81 10 80       	push   $0x80108148
80106340:	e8 5b a3 ff ff       	call   801006a0 <cprintf>
      panic("trap");
80106345:	83 c4 14             	add    $0x14,%esp
80106348:	68 1e 81 10 80       	push   $0x8010811e
8010634d:	e8 2e a0 ff ff       	call   80100380 <panic>
80106352:	66 90                	xchg   %ax,%ax
80106354:	66 90                	xchg   %ax,%ax
80106356:	66 90                	xchg   %ax,%ax
80106358:	66 90                	xchg   %ax,%ax
8010635a:	66 90                	xchg   %ax,%ax
8010635c:	66 90                	xchg   %ax,%ax
8010635e:	66 90                	xchg   %ax,%ax

80106360 <uartgetc>:
}

static int
uartgetc(void)
{
  if(!uart)
80106360:	a1 c0 d6 11 80       	mov    0x8011d6c0,%eax
80106365:	85 c0                	test   %eax,%eax
80106367:	74 17                	je     80106380 <uartgetc+0x20>
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
80106369:	ba fd 03 00 00       	mov    $0x3fd,%edx
8010636e:	ec                   	in     (%dx),%al
    return -1;
  if(!(inb(COM1+5) & 0x01))
8010636f:	a8 01                	test   $0x1,%al
80106371:	74 0d                	je     80106380 <uartgetc+0x20>
80106373:	ba f8 03 00 00       	mov    $0x3f8,%edx
80106378:	ec                   	in     (%dx),%al
    return -1;
  return inb(COM1+0);
80106379:	0f b6 c0             	movzbl %al,%eax
8010637c:	c3                   	ret    
8010637d:	8d 76 00             	lea    0x0(%esi),%esi
    return -1;
80106380:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80106385:	c3                   	ret    
80106386:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010638d:	8d 76 00             	lea    0x0(%esi),%esi

80106390 <uartinit>:
{
80106390:	55                   	push   %ebp
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80106391:	31 c9                	xor    %ecx,%ecx
80106393:	89 c8                	mov    %ecx,%eax
80106395:	89 e5                	mov    %esp,%ebp
80106397:	57                   	push   %edi
80106398:	bf fa 03 00 00       	mov    $0x3fa,%edi
8010639d:	56                   	push   %esi
8010639e:	89 fa                	mov    %edi,%edx
801063a0:	53                   	push   %ebx
801063a1:	83 ec 1c             	sub    $0x1c,%esp
801063a4:	ee                   	out    %al,(%dx)
801063a5:	be fb 03 00 00       	mov    $0x3fb,%esi
801063aa:	b8 80 ff ff ff       	mov    $0xffffff80,%eax
801063af:	89 f2                	mov    %esi,%edx
801063b1:	ee                   	out    %al,(%dx)
801063b2:	b8 0c 00 00 00       	mov    $0xc,%eax
801063b7:	ba f8 03 00 00       	mov    $0x3f8,%edx
801063bc:	ee                   	out    %al,(%dx)
801063bd:	bb f9 03 00 00       	mov    $0x3f9,%ebx
801063c2:	89 c8                	mov    %ecx,%eax
801063c4:	89 da                	mov    %ebx,%edx
801063c6:	ee                   	out    %al,(%dx)
801063c7:	b8 03 00 00 00       	mov    $0x3,%eax
801063cc:	89 f2                	mov    %esi,%edx
801063ce:	ee                   	out    %al,(%dx)
801063cf:	ba fc 03 00 00       	mov    $0x3fc,%edx
801063d4:	89 c8                	mov    %ecx,%eax
801063d6:	ee                   	out    %al,(%dx)
801063d7:	b8 01 00 00 00       	mov    $0x1,%eax
801063dc:	89 da                	mov    %ebx,%edx
801063de:	ee                   	out    %al,(%dx)
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
801063df:	ba fd 03 00 00       	mov    $0x3fd,%edx
801063e4:	ec                   	in     (%dx),%al
  if(inb(COM1+5) == 0xFF)
801063e5:	3c ff                	cmp    $0xff,%al
801063e7:	74 78                	je     80106461 <uartinit+0xd1>
  uart = 1;
801063e9:	c7 05 c0 d6 11 80 01 	movl   $0x1,0x8011d6c0
801063f0:	00 00 00 
801063f3:	89 fa                	mov    %edi,%edx
801063f5:	ec                   	in     (%dx),%al
801063f6:	ba f8 03 00 00       	mov    $0x3f8,%edx
801063fb:	ec                   	in     (%dx),%al
  ioapicenable(IRQ_COM1, 0);
801063fc:	83 ec 08             	sub    $0x8,%esp
  for(p="xv6...\n"; *p; p++)
801063ff:	bf 40 82 10 80       	mov    $0x80108240,%edi
80106404:	be fd 03 00 00       	mov    $0x3fd,%esi
  ioapicenable(IRQ_COM1, 0);
80106409:	6a 00                	push   $0x0
8010640b:	6a 04                	push   $0x4
8010640d:	e8 8e c0 ff ff       	call   801024a0 <ioapicenable>
  for(p="xv6...\n"; *p; p++)
80106412:	c6 45 e7 78          	movb   $0x78,-0x19(%ebp)
  ioapicenable(IRQ_COM1, 0);
80106416:	83 c4 10             	add    $0x10,%esp
80106419:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  if(!uart)
80106420:	a1 c0 d6 11 80       	mov    0x8011d6c0,%eax
80106425:	bb 80 00 00 00       	mov    $0x80,%ebx
8010642a:	85 c0                	test   %eax,%eax
8010642c:	75 14                	jne    80106442 <uartinit+0xb2>
8010642e:	eb 23                	jmp    80106453 <uartinit+0xc3>
    microdelay(10);
80106430:	83 ec 0c             	sub    $0xc,%esp
80106433:	6a 0a                	push   $0xa
80106435:	e8 16 c5 ff ff       	call   80102950 <microdelay>
  for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
8010643a:	83 c4 10             	add    $0x10,%esp
8010643d:	83 eb 01             	sub    $0x1,%ebx
80106440:	74 07                	je     80106449 <uartinit+0xb9>
80106442:	89 f2                	mov    %esi,%edx
80106444:	ec                   	in     (%dx),%al
80106445:	a8 20                	test   $0x20,%al
80106447:	74 e7                	je     80106430 <uartinit+0xa0>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
80106449:	0f b6 45 e7          	movzbl -0x19(%ebp),%eax
8010644d:	ba f8 03 00 00       	mov    $0x3f8,%edx
80106452:	ee                   	out    %al,(%dx)
  for(p="xv6...\n"; *p; p++)
80106453:	0f b6 47 01          	movzbl 0x1(%edi),%eax
80106457:	83 c7 01             	add    $0x1,%edi
8010645a:	88 45 e7             	mov    %al,-0x19(%ebp)
8010645d:	84 c0                	test   %al,%al
8010645f:	75 bf                	jne    80106420 <uartinit+0x90>
}
80106461:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106464:	5b                   	pop    %ebx
80106465:	5e                   	pop    %esi
80106466:	5f                   	pop    %edi
80106467:	5d                   	pop    %ebp
80106468:	c3                   	ret    
80106469:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80106470 <uartputc>:
  if(!uart)
80106470:	a1 c0 d6 11 80       	mov    0x8011d6c0,%eax
80106475:	85 c0                	test   %eax,%eax
80106477:	74 47                	je     801064c0 <uartputc+0x50>
{
80106479:	55                   	push   %ebp
8010647a:	89 e5                	mov    %esp,%ebp
8010647c:	56                   	push   %esi
  asm volatile("in %1,%0" : "=a" (data) : "d" (port));
8010647d:	be fd 03 00 00       	mov    $0x3fd,%esi
80106482:	53                   	push   %ebx
80106483:	bb 80 00 00 00       	mov    $0x80,%ebx
80106488:	eb 18                	jmp    801064a2 <uartputc+0x32>
8010648a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
    microdelay(10);
80106490:	83 ec 0c             	sub    $0xc,%esp
80106493:	6a 0a                	push   $0xa
80106495:	e8 b6 c4 ff ff       	call   80102950 <microdelay>
  for(i = 0; i < 128 && !(inb(COM1+5) & 0x20); i++)
8010649a:	83 c4 10             	add    $0x10,%esp
8010649d:	83 eb 01             	sub    $0x1,%ebx
801064a0:	74 07                	je     801064a9 <uartputc+0x39>
801064a2:	89 f2                	mov    %esi,%edx
801064a4:	ec                   	in     (%dx),%al
801064a5:	a8 20                	test   $0x20,%al
801064a7:	74 e7                	je     80106490 <uartputc+0x20>
  asm volatile("out %0,%1" : : "a" (data), "d" (port));
801064a9:	8b 45 08             	mov    0x8(%ebp),%eax
801064ac:	ba f8 03 00 00       	mov    $0x3f8,%edx
801064b1:	ee                   	out    %al,(%dx)
}
801064b2:	8d 65 f8             	lea    -0x8(%ebp),%esp
801064b5:	5b                   	pop    %ebx
801064b6:	5e                   	pop    %esi
801064b7:	5d                   	pop    %ebp
801064b8:	c3                   	ret    
801064b9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801064c0:	c3                   	ret    
801064c1:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801064c8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801064cf:	90                   	nop

801064d0 <uartintr>:

void
uartintr(void)
{
801064d0:	55                   	push   %ebp
801064d1:	89 e5                	mov    %esp,%ebp
801064d3:	83 ec 14             	sub    $0x14,%esp
  consoleintr(uartgetc);
801064d6:	68 60 63 10 80       	push   $0x80106360
801064db:	e8 a0 a3 ff ff       	call   80100880 <consoleintr>
}
801064e0:	83 c4 10             	add    $0x10,%esp
801064e3:	c9                   	leave  
801064e4:	c3                   	ret    

801064e5 <vector0>:
# generated by vectors.pl - do not edit
# handlers
.globl alltraps
.globl vector0
vector0:
  pushl $0
801064e5:	6a 00                	push   $0x0
  pushl $0
801064e7:	6a 00                	push   $0x0
  jmp alltraps
801064e9:	e9 c9 fa ff ff       	jmp    80105fb7 <alltraps>

801064ee <vector1>:
.globl vector1
vector1:
  pushl $0
801064ee:	6a 00                	push   $0x0
  pushl $1
801064f0:	6a 01                	push   $0x1
  jmp alltraps
801064f2:	e9 c0 fa ff ff       	jmp    80105fb7 <alltraps>

801064f7 <vector2>:
.globl vector2
vector2:
  pushl $0
801064f7:	6a 00                	push   $0x0
  pushl $2
801064f9:	6a 02                	push   $0x2
  jmp alltraps
801064fb:	e9 b7 fa ff ff       	jmp    80105fb7 <alltraps>

80106500 <vector3>:
.globl vector3
vector3:
  pushl $0
80106500:	6a 00                	push   $0x0
  pushl $3
80106502:	6a 03                	push   $0x3
  jmp alltraps
80106504:	e9 ae fa ff ff       	jmp    80105fb7 <alltraps>

80106509 <vector4>:
.globl vector4
vector4:
  pushl $0
80106509:	6a 00                	push   $0x0
  pushl $4
8010650b:	6a 04                	push   $0x4
  jmp alltraps
8010650d:	e9 a5 fa ff ff       	jmp    80105fb7 <alltraps>

80106512 <vector5>:
.globl vector5
vector5:
  pushl $0
80106512:	6a 00                	push   $0x0
  pushl $5
80106514:	6a 05                	push   $0x5
  jmp alltraps
80106516:	e9 9c fa ff ff       	jmp    80105fb7 <alltraps>

8010651b <vector6>:
.globl vector6
vector6:
  pushl $0
8010651b:	6a 00                	push   $0x0
  pushl $6
8010651d:	6a 06                	push   $0x6
  jmp alltraps
8010651f:	e9 93 fa ff ff       	jmp    80105fb7 <alltraps>

80106524 <vector7>:
.globl vector7
vector7:
  pushl $0
80106524:	6a 00                	push   $0x0
  pushl $7
80106526:	6a 07                	push   $0x7
  jmp alltraps
80106528:	e9 8a fa ff ff       	jmp    80105fb7 <alltraps>

8010652d <vector8>:
.globl vector8
vector8:
  pushl $8
8010652d:	6a 08                	push   $0x8
  jmp alltraps
8010652f:	e9 83 fa ff ff       	jmp    80105fb7 <alltraps>

80106534 <vector9>:
.globl vector9
vector9:
  pushl $0
80106534:	6a 00                	push   $0x0
  pushl $9
80106536:	6a 09                	push   $0x9
  jmp alltraps
80106538:	e9 7a fa ff ff       	jmp    80105fb7 <alltraps>

8010653d <vector10>:
.globl vector10
vector10:
  pushl $10
8010653d:	6a 0a                	push   $0xa
  jmp alltraps
8010653f:	e9 73 fa ff ff       	jmp    80105fb7 <alltraps>

80106544 <vector11>:
.globl vector11
vector11:
  pushl $11
80106544:	6a 0b                	push   $0xb
  jmp alltraps
80106546:	e9 6c fa ff ff       	jmp    80105fb7 <alltraps>

8010654b <vector12>:
.globl vector12
vector12:
  pushl $12
8010654b:	6a 0c                	push   $0xc
  jmp alltraps
8010654d:	e9 65 fa ff ff       	jmp    80105fb7 <alltraps>

80106552 <vector13>:
.globl vector13
vector13:
  pushl $13
80106552:	6a 0d                	push   $0xd
  jmp alltraps
80106554:	e9 5e fa ff ff       	jmp    80105fb7 <alltraps>

80106559 <vector14>:
.globl vector14
vector14:
  pushl $14
80106559:	6a 0e                	push   $0xe
  jmp alltraps
8010655b:	e9 57 fa ff ff       	jmp    80105fb7 <alltraps>

80106560 <vector15>:
.globl vector15
vector15:
  pushl $0
80106560:	6a 00                	push   $0x0
  pushl $15
80106562:	6a 0f                	push   $0xf
  jmp alltraps
80106564:	e9 4e fa ff ff       	jmp    80105fb7 <alltraps>

80106569 <vector16>:
.globl vector16
vector16:
  pushl $0
80106569:	6a 00                	push   $0x0
  pushl $16
8010656b:	6a 10                	push   $0x10
  jmp alltraps
8010656d:	e9 45 fa ff ff       	jmp    80105fb7 <alltraps>

80106572 <vector17>:
.globl vector17
vector17:
  pushl $17
80106572:	6a 11                	push   $0x11
  jmp alltraps
80106574:	e9 3e fa ff ff       	jmp    80105fb7 <alltraps>

80106579 <vector18>:
.globl vector18
vector18:
  pushl $0
80106579:	6a 00                	push   $0x0
  pushl $18
8010657b:	6a 12                	push   $0x12
  jmp alltraps
8010657d:	e9 35 fa ff ff       	jmp    80105fb7 <alltraps>

80106582 <vector19>:
.globl vector19
vector19:
  pushl $0
80106582:	6a 00                	push   $0x0
  pushl $19
80106584:	6a 13                	push   $0x13
  jmp alltraps
80106586:	e9 2c fa ff ff       	jmp    80105fb7 <alltraps>

8010658b <vector20>:
.globl vector20
vector20:
  pushl $0
8010658b:	6a 00                	push   $0x0
  pushl $20
8010658d:	6a 14                	push   $0x14
  jmp alltraps
8010658f:	e9 23 fa ff ff       	jmp    80105fb7 <alltraps>

80106594 <vector21>:
.globl vector21
vector21:
  pushl $0
80106594:	6a 00                	push   $0x0
  pushl $21
80106596:	6a 15                	push   $0x15
  jmp alltraps
80106598:	e9 1a fa ff ff       	jmp    80105fb7 <alltraps>

8010659d <vector22>:
.globl vector22
vector22:
  pushl $0
8010659d:	6a 00                	push   $0x0
  pushl $22
8010659f:	6a 16                	push   $0x16
  jmp alltraps
801065a1:	e9 11 fa ff ff       	jmp    80105fb7 <alltraps>

801065a6 <vector23>:
.globl vector23
vector23:
  pushl $0
801065a6:	6a 00                	push   $0x0
  pushl $23
801065a8:	6a 17                	push   $0x17
  jmp alltraps
801065aa:	e9 08 fa ff ff       	jmp    80105fb7 <alltraps>

801065af <vector24>:
.globl vector24
vector24:
  pushl $0
801065af:	6a 00                	push   $0x0
  pushl $24
801065b1:	6a 18                	push   $0x18
  jmp alltraps
801065b3:	e9 ff f9 ff ff       	jmp    80105fb7 <alltraps>

801065b8 <vector25>:
.globl vector25
vector25:
  pushl $0
801065b8:	6a 00                	push   $0x0
  pushl $25
801065ba:	6a 19                	push   $0x19
  jmp alltraps
801065bc:	e9 f6 f9 ff ff       	jmp    80105fb7 <alltraps>

801065c1 <vector26>:
.globl vector26
vector26:
  pushl $0
801065c1:	6a 00                	push   $0x0
  pushl $26
801065c3:	6a 1a                	push   $0x1a
  jmp alltraps
801065c5:	e9 ed f9 ff ff       	jmp    80105fb7 <alltraps>

801065ca <vector27>:
.globl vector27
vector27:
  pushl $0
801065ca:	6a 00                	push   $0x0
  pushl $27
801065cc:	6a 1b                	push   $0x1b
  jmp alltraps
801065ce:	e9 e4 f9 ff ff       	jmp    80105fb7 <alltraps>

801065d3 <vector28>:
.globl vector28
vector28:
  pushl $0
801065d3:	6a 00                	push   $0x0
  pushl $28
801065d5:	6a 1c                	push   $0x1c
  jmp alltraps
801065d7:	e9 db f9 ff ff       	jmp    80105fb7 <alltraps>

801065dc <vector29>:
.globl vector29
vector29:
  pushl $0
801065dc:	6a 00                	push   $0x0
  pushl $29
801065de:	6a 1d                	push   $0x1d
  jmp alltraps
801065e0:	e9 d2 f9 ff ff       	jmp    80105fb7 <alltraps>

801065e5 <vector30>:
.globl vector30
vector30:
  pushl $0
801065e5:	6a 00                	push   $0x0
  pushl $30
801065e7:	6a 1e                	push   $0x1e
  jmp alltraps
801065e9:	e9 c9 f9 ff ff       	jmp    80105fb7 <alltraps>

801065ee <vector31>:
.globl vector31
vector31:
  pushl $0
801065ee:	6a 00                	push   $0x0
  pushl $31
801065f0:	6a 1f                	push   $0x1f
  jmp alltraps
801065f2:	e9 c0 f9 ff ff       	jmp    80105fb7 <alltraps>

801065f7 <vector32>:
.globl vector32
vector32:
  pushl $0
801065f7:	6a 00                	push   $0x0
  pushl $32
801065f9:	6a 20                	push   $0x20
  jmp alltraps
801065fb:	e9 b7 f9 ff ff       	jmp    80105fb7 <alltraps>

80106600 <vector33>:
.globl vector33
vector33:
  pushl $0
80106600:	6a 00                	push   $0x0
  pushl $33
80106602:	6a 21                	push   $0x21
  jmp alltraps
80106604:	e9 ae f9 ff ff       	jmp    80105fb7 <alltraps>

80106609 <vector34>:
.globl vector34
vector34:
  pushl $0
80106609:	6a 00                	push   $0x0
  pushl $34
8010660b:	6a 22                	push   $0x22
  jmp alltraps
8010660d:	e9 a5 f9 ff ff       	jmp    80105fb7 <alltraps>

80106612 <vector35>:
.globl vector35
vector35:
  pushl $0
80106612:	6a 00                	push   $0x0
  pushl $35
80106614:	6a 23                	push   $0x23
  jmp alltraps
80106616:	e9 9c f9 ff ff       	jmp    80105fb7 <alltraps>

8010661b <vector36>:
.globl vector36
vector36:
  pushl $0
8010661b:	6a 00                	push   $0x0
  pushl $36
8010661d:	6a 24                	push   $0x24
  jmp alltraps
8010661f:	e9 93 f9 ff ff       	jmp    80105fb7 <alltraps>

80106624 <vector37>:
.globl vector37
vector37:
  pushl $0
80106624:	6a 00                	push   $0x0
  pushl $37
80106626:	6a 25                	push   $0x25
  jmp alltraps
80106628:	e9 8a f9 ff ff       	jmp    80105fb7 <alltraps>

8010662d <vector38>:
.globl vector38
vector38:
  pushl $0
8010662d:	6a 00                	push   $0x0
  pushl $38
8010662f:	6a 26                	push   $0x26
  jmp alltraps
80106631:	e9 81 f9 ff ff       	jmp    80105fb7 <alltraps>

80106636 <vector39>:
.globl vector39
vector39:
  pushl $0
80106636:	6a 00                	push   $0x0
  pushl $39
80106638:	6a 27                	push   $0x27
  jmp alltraps
8010663a:	e9 78 f9 ff ff       	jmp    80105fb7 <alltraps>

8010663f <vector40>:
.globl vector40
vector40:
  pushl $0
8010663f:	6a 00                	push   $0x0
  pushl $40
80106641:	6a 28                	push   $0x28
  jmp alltraps
80106643:	e9 6f f9 ff ff       	jmp    80105fb7 <alltraps>

80106648 <vector41>:
.globl vector41
vector41:
  pushl $0
80106648:	6a 00                	push   $0x0
  pushl $41
8010664a:	6a 29                	push   $0x29
  jmp alltraps
8010664c:	e9 66 f9 ff ff       	jmp    80105fb7 <alltraps>

80106651 <vector42>:
.globl vector42
vector42:
  pushl $0
80106651:	6a 00                	push   $0x0
  pushl $42
80106653:	6a 2a                	push   $0x2a
  jmp alltraps
80106655:	e9 5d f9 ff ff       	jmp    80105fb7 <alltraps>

8010665a <vector43>:
.globl vector43
vector43:
  pushl $0
8010665a:	6a 00                	push   $0x0
  pushl $43
8010665c:	6a 2b                	push   $0x2b
  jmp alltraps
8010665e:	e9 54 f9 ff ff       	jmp    80105fb7 <alltraps>

80106663 <vector44>:
.globl vector44
vector44:
  pushl $0
80106663:	6a 00                	push   $0x0
  pushl $44
80106665:	6a 2c                	push   $0x2c
  jmp alltraps
80106667:	e9 4b f9 ff ff       	jmp    80105fb7 <alltraps>

8010666c <vector45>:
.globl vector45
vector45:
  pushl $0
8010666c:	6a 00                	push   $0x0
  pushl $45
8010666e:	6a 2d                	push   $0x2d
  jmp alltraps
80106670:	e9 42 f9 ff ff       	jmp    80105fb7 <alltraps>

80106675 <vector46>:
.globl vector46
vector46:
  pushl $0
80106675:	6a 00                	push   $0x0
  pushl $46
80106677:	6a 2e                	push   $0x2e
  jmp alltraps
80106679:	e9 39 f9 ff ff       	jmp    80105fb7 <alltraps>

8010667e <vector47>:
.globl vector47
vector47:
  pushl $0
8010667e:	6a 00                	push   $0x0
  pushl $47
80106680:	6a 2f                	push   $0x2f
  jmp alltraps
80106682:	e9 30 f9 ff ff       	jmp    80105fb7 <alltraps>

80106687 <vector48>:
.globl vector48
vector48:
  pushl $0
80106687:	6a 00                	push   $0x0
  pushl $48
80106689:	6a 30                	push   $0x30
  jmp alltraps
8010668b:	e9 27 f9 ff ff       	jmp    80105fb7 <alltraps>

80106690 <vector49>:
.globl vector49
vector49:
  pushl $0
80106690:	6a 00                	push   $0x0
  pushl $49
80106692:	6a 31                	push   $0x31
  jmp alltraps
80106694:	e9 1e f9 ff ff       	jmp    80105fb7 <alltraps>

80106699 <vector50>:
.globl vector50
vector50:
  pushl $0
80106699:	6a 00                	push   $0x0
  pushl $50
8010669b:	6a 32                	push   $0x32
  jmp alltraps
8010669d:	e9 15 f9 ff ff       	jmp    80105fb7 <alltraps>

801066a2 <vector51>:
.globl vector51
vector51:
  pushl $0
801066a2:	6a 00                	push   $0x0
  pushl $51
801066a4:	6a 33                	push   $0x33
  jmp alltraps
801066a6:	e9 0c f9 ff ff       	jmp    80105fb7 <alltraps>

801066ab <vector52>:
.globl vector52
vector52:
  pushl $0
801066ab:	6a 00                	push   $0x0
  pushl $52
801066ad:	6a 34                	push   $0x34
  jmp alltraps
801066af:	e9 03 f9 ff ff       	jmp    80105fb7 <alltraps>

801066b4 <vector53>:
.globl vector53
vector53:
  pushl $0
801066b4:	6a 00                	push   $0x0
  pushl $53
801066b6:	6a 35                	push   $0x35
  jmp alltraps
801066b8:	e9 fa f8 ff ff       	jmp    80105fb7 <alltraps>

801066bd <vector54>:
.globl vector54
vector54:
  pushl $0
801066bd:	6a 00                	push   $0x0
  pushl $54
801066bf:	6a 36                	push   $0x36
  jmp alltraps
801066c1:	e9 f1 f8 ff ff       	jmp    80105fb7 <alltraps>

801066c6 <vector55>:
.globl vector55
vector55:
  pushl $0
801066c6:	6a 00                	push   $0x0
  pushl $55
801066c8:	6a 37                	push   $0x37
  jmp alltraps
801066ca:	e9 e8 f8 ff ff       	jmp    80105fb7 <alltraps>

801066cf <vector56>:
.globl vector56
vector56:
  pushl $0
801066cf:	6a 00                	push   $0x0
  pushl $56
801066d1:	6a 38                	push   $0x38
  jmp alltraps
801066d3:	e9 df f8 ff ff       	jmp    80105fb7 <alltraps>

801066d8 <vector57>:
.globl vector57
vector57:
  pushl $0
801066d8:	6a 00                	push   $0x0
  pushl $57
801066da:	6a 39                	push   $0x39
  jmp alltraps
801066dc:	e9 d6 f8 ff ff       	jmp    80105fb7 <alltraps>

801066e1 <vector58>:
.globl vector58
vector58:
  pushl $0
801066e1:	6a 00                	push   $0x0
  pushl $58
801066e3:	6a 3a                	push   $0x3a
  jmp alltraps
801066e5:	e9 cd f8 ff ff       	jmp    80105fb7 <alltraps>

801066ea <vector59>:
.globl vector59
vector59:
  pushl $0
801066ea:	6a 00                	push   $0x0
  pushl $59
801066ec:	6a 3b                	push   $0x3b
  jmp alltraps
801066ee:	e9 c4 f8 ff ff       	jmp    80105fb7 <alltraps>

801066f3 <vector60>:
.globl vector60
vector60:
  pushl $0
801066f3:	6a 00                	push   $0x0
  pushl $60
801066f5:	6a 3c                	push   $0x3c
  jmp alltraps
801066f7:	e9 bb f8 ff ff       	jmp    80105fb7 <alltraps>

801066fc <vector61>:
.globl vector61
vector61:
  pushl $0
801066fc:	6a 00                	push   $0x0
  pushl $61
801066fe:	6a 3d                	push   $0x3d
  jmp alltraps
80106700:	e9 b2 f8 ff ff       	jmp    80105fb7 <alltraps>

80106705 <vector62>:
.globl vector62
vector62:
  pushl $0
80106705:	6a 00                	push   $0x0
  pushl $62
80106707:	6a 3e                	push   $0x3e
  jmp alltraps
80106709:	e9 a9 f8 ff ff       	jmp    80105fb7 <alltraps>

8010670e <vector63>:
.globl vector63
vector63:
  pushl $0
8010670e:	6a 00                	push   $0x0
  pushl $63
80106710:	6a 3f                	push   $0x3f
  jmp alltraps
80106712:	e9 a0 f8 ff ff       	jmp    80105fb7 <alltraps>

80106717 <vector64>:
.globl vector64
vector64:
  pushl $0
80106717:	6a 00                	push   $0x0
  pushl $64
80106719:	6a 40                	push   $0x40
  jmp alltraps
8010671b:	e9 97 f8 ff ff       	jmp    80105fb7 <alltraps>

80106720 <vector65>:
.globl vector65
vector65:
  pushl $0
80106720:	6a 00                	push   $0x0
  pushl $65
80106722:	6a 41                	push   $0x41
  jmp alltraps
80106724:	e9 8e f8 ff ff       	jmp    80105fb7 <alltraps>

80106729 <vector66>:
.globl vector66
vector66:
  pushl $0
80106729:	6a 00                	push   $0x0
  pushl $66
8010672b:	6a 42                	push   $0x42
  jmp alltraps
8010672d:	e9 85 f8 ff ff       	jmp    80105fb7 <alltraps>

80106732 <vector67>:
.globl vector67
vector67:
  pushl $0
80106732:	6a 00                	push   $0x0
  pushl $67
80106734:	6a 43                	push   $0x43
  jmp alltraps
80106736:	e9 7c f8 ff ff       	jmp    80105fb7 <alltraps>

8010673b <vector68>:
.globl vector68
vector68:
  pushl $0
8010673b:	6a 00                	push   $0x0
  pushl $68
8010673d:	6a 44                	push   $0x44
  jmp alltraps
8010673f:	e9 73 f8 ff ff       	jmp    80105fb7 <alltraps>

80106744 <vector69>:
.globl vector69
vector69:
  pushl $0
80106744:	6a 00                	push   $0x0
  pushl $69
80106746:	6a 45                	push   $0x45
  jmp alltraps
80106748:	e9 6a f8 ff ff       	jmp    80105fb7 <alltraps>

8010674d <vector70>:
.globl vector70
vector70:
  pushl $0
8010674d:	6a 00                	push   $0x0
  pushl $70
8010674f:	6a 46                	push   $0x46
  jmp alltraps
80106751:	e9 61 f8 ff ff       	jmp    80105fb7 <alltraps>

80106756 <vector71>:
.globl vector71
vector71:
  pushl $0
80106756:	6a 00                	push   $0x0
  pushl $71
80106758:	6a 47                	push   $0x47
  jmp alltraps
8010675a:	e9 58 f8 ff ff       	jmp    80105fb7 <alltraps>

8010675f <vector72>:
.globl vector72
vector72:
  pushl $0
8010675f:	6a 00                	push   $0x0
  pushl $72
80106761:	6a 48                	push   $0x48
  jmp alltraps
80106763:	e9 4f f8 ff ff       	jmp    80105fb7 <alltraps>

80106768 <vector73>:
.globl vector73
vector73:
  pushl $0
80106768:	6a 00                	push   $0x0
  pushl $73
8010676a:	6a 49                	push   $0x49
  jmp alltraps
8010676c:	e9 46 f8 ff ff       	jmp    80105fb7 <alltraps>

80106771 <vector74>:
.globl vector74
vector74:
  pushl $0
80106771:	6a 00                	push   $0x0
  pushl $74
80106773:	6a 4a                	push   $0x4a
  jmp alltraps
80106775:	e9 3d f8 ff ff       	jmp    80105fb7 <alltraps>

8010677a <vector75>:
.globl vector75
vector75:
  pushl $0
8010677a:	6a 00                	push   $0x0
  pushl $75
8010677c:	6a 4b                	push   $0x4b
  jmp alltraps
8010677e:	e9 34 f8 ff ff       	jmp    80105fb7 <alltraps>

80106783 <vector76>:
.globl vector76
vector76:
  pushl $0
80106783:	6a 00                	push   $0x0
  pushl $76
80106785:	6a 4c                	push   $0x4c
  jmp alltraps
80106787:	e9 2b f8 ff ff       	jmp    80105fb7 <alltraps>

8010678c <vector77>:
.globl vector77
vector77:
  pushl $0
8010678c:	6a 00                	push   $0x0
  pushl $77
8010678e:	6a 4d                	push   $0x4d
  jmp alltraps
80106790:	e9 22 f8 ff ff       	jmp    80105fb7 <alltraps>

80106795 <vector78>:
.globl vector78
vector78:
  pushl $0
80106795:	6a 00                	push   $0x0
  pushl $78
80106797:	6a 4e                	push   $0x4e
  jmp alltraps
80106799:	e9 19 f8 ff ff       	jmp    80105fb7 <alltraps>

8010679e <vector79>:
.globl vector79
vector79:
  pushl $0
8010679e:	6a 00                	push   $0x0
  pushl $79
801067a0:	6a 4f                	push   $0x4f
  jmp alltraps
801067a2:	e9 10 f8 ff ff       	jmp    80105fb7 <alltraps>

801067a7 <vector80>:
.globl vector80
vector80:
  pushl $0
801067a7:	6a 00                	push   $0x0
  pushl $80
801067a9:	6a 50                	push   $0x50
  jmp alltraps
801067ab:	e9 07 f8 ff ff       	jmp    80105fb7 <alltraps>

801067b0 <vector81>:
.globl vector81
vector81:
  pushl $0
801067b0:	6a 00                	push   $0x0
  pushl $81
801067b2:	6a 51                	push   $0x51
  jmp alltraps
801067b4:	e9 fe f7 ff ff       	jmp    80105fb7 <alltraps>

801067b9 <vector82>:
.globl vector82
vector82:
  pushl $0
801067b9:	6a 00                	push   $0x0
  pushl $82
801067bb:	6a 52                	push   $0x52
  jmp alltraps
801067bd:	e9 f5 f7 ff ff       	jmp    80105fb7 <alltraps>

801067c2 <vector83>:
.globl vector83
vector83:
  pushl $0
801067c2:	6a 00                	push   $0x0
  pushl $83
801067c4:	6a 53                	push   $0x53
  jmp alltraps
801067c6:	e9 ec f7 ff ff       	jmp    80105fb7 <alltraps>

801067cb <vector84>:
.globl vector84
vector84:
  pushl $0
801067cb:	6a 00                	push   $0x0
  pushl $84
801067cd:	6a 54                	push   $0x54
  jmp alltraps
801067cf:	e9 e3 f7 ff ff       	jmp    80105fb7 <alltraps>

801067d4 <vector85>:
.globl vector85
vector85:
  pushl $0
801067d4:	6a 00                	push   $0x0
  pushl $85
801067d6:	6a 55                	push   $0x55
  jmp alltraps
801067d8:	e9 da f7 ff ff       	jmp    80105fb7 <alltraps>

801067dd <vector86>:
.globl vector86
vector86:
  pushl $0
801067dd:	6a 00                	push   $0x0
  pushl $86
801067df:	6a 56                	push   $0x56
  jmp alltraps
801067e1:	e9 d1 f7 ff ff       	jmp    80105fb7 <alltraps>

801067e6 <vector87>:
.globl vector87
vector87:
  pushl $0
801067e6:	6a 00                	push   $0x0
  pushl $87
801067e8:	6a 57                	push   $0x57
  jmp alltraps
801067ea:	e9 c8 f7 ff ff       	jmp    80105fb7 <alltraps>

801067ef <vector88>:
.globl vector88
vector88:
  pushl $0
801067ef:	6a 00                	push   $0x0
  pushl $88
801067f1:	6a 58                	push   $0x58
  jmp alltraps
801067f3:	e9 bf f7 ff ff       	jmp    80105fb7 <alltraps>

801067f8 <vector89>:
.globl vector89
vector89:
  pushl $0
801067f8:	6a 00                	push   $0x0
  pushl $89
801067fa:	6a 59                	push   $0x59
  jmp alltraps
801067fc:	e9 b6 f7 ff ff       	jmp    80105fb7 <alltraps>

80106801 <vector90>:
.globl vector90
vector90:
  pushl $0
80106801:	6a 00                	push   $0x0
  pushl $90
80106803:	6a 5a                	push   $0x5a
  jmp alltraps
80106805:	e9 ad f7 ff ff       	jmp    80105fb7 <alltraps>

8010680a <vector91>:
.globl vector91
vector91:
  pushl $0
8010680a:	6a 00                	push   $0x0
  pushl $91
8010680c:	6a 5b                	push   $0x5b
  jmp alltraps
8010680e:	e9 a4 f7 ff ff       	jmp    80105fb7 <alltraps>

80106813 <vector92>:
.globl vector92
vector92:
  pushl $0
80106813:	6a 00                	push   $0x0
  pushl $92
80106815:	6a 5c                	push   $0x5c
  jmp alltraps
80106817:	e9 9b f7 ff ff       	jmp    80105fb7 <alltraps>

8010681c <vector93>:
.globl vector93
vector93:
  pushl $0
8010681c:	6a 00                	push   $0x0
  pushl $93
8010681e:	6a 5d                	push   $0x5d
  jmp alltraps
80106820:	e9 92 f7 ff ff       	jmp    80105fb7 <alltraps>

80106825 <vector94>:
.globl vector94
vector94:
  pushl $0
80106825:	6a 00                	push   $0x0
  pushl $94
80106827:	6a 5e                	push   $0x5e
  jmp alltraps
80106829:	e9 89 f7 ff ff       	jmp    80105fb7 <alltraps>

8010682e <vector95>:
.globl vector95
vector95:
  pushl $0
8010682e:	6a 00                	push   $0x0
  pushl $95
80106830:	6a 5f                	push   $0x5f
  jmp alltraps
80106832:	e9 80 f7 ff ff       	jmp    80105fb7 <alltraps>

80106837 <vector96>:
.globl vector96
vector96:
  pushl $0
80106837:	6a 00                	push   $0x0
  pushl $96
80106839:	6a 60                	push   $0x60
  jmp alltraps
8010683b:	e9 77 f7 ff ff       	jmp    80105fb7 <alltraps>

80106840 <vector97>:
.globl vector97
vector97:
  pushl $0
80106840:	6a 00                	push   $0x0
  pushl $97
80106842:	6a 61                	push   $0x61
  jmp alltraps
80106844:	e9 6e f7 ff ff       	jmp    80105fb7 <alltraps>

80106849 <vector98>:
.globl vector98
vector98:
  pushl $0
80106849:	6a 00                	push   $0x0
  pushl $98
8010684b:	6a 62                	push   $0x62
  jmp alltraps
8010684d:	e9 65 f7 ff ff       	jmp    80105fb7 <alltraps>

80106852 <vector99>:
.globl vector99
vector99:
  pushl $0
80106852:	6a 00                	push   $0x0
  pushl $99
80106854:	6a 63                	push   $0x63
  jmp alltraps
80106856:	e9 5c f7 ff ff       	jmp    80105fb7 <alltraps>

8010685b <vector100>:
.globl vector100
vector100:
  pushl $0
8010685b:	6a 00                	push   $0x0
  pushl $100
8010685d:	6a 64                	push   $0x64
  jmp alltraps
8010685f:	e9 53 f7 ff ff       	jmp    80105fb7 <alltraps>

80106864 <vector101>:
.globl vector101
vector101:
  pushl $0
80106864:	6a 00                	push   $0x0
  pushl $101
80106866:	6a 65                	push   $0x65
  jmp alltraps
80106868:	e9 4a f7 ff ff       	jmp    80105fb7 <alltraps>

8010686d <vector102>:
.globl vector102
vector102:
  pushl $0
8010686d:	6a 00                	push   $0x0
  pushl $102
8010686f:	6a 66                	push   $0x66
  jmp alltraps
80106871:	e9 41 f7 ff ff       	jmp    80105fb7 <alltraps>

80106876 <vector103>:
.globl vector103
vector103:
  pushl $0
80106876:	6a 00                	push   $0x0
  pushl $103
80106878:	6a 67                	push   $0x67
  jmp alltraps
8010687a:	e9 38 f7 ff ff       	jmp    80105fb7 <alltraps>

8010687f <vector104>:
.globl vector104
vector104:
  pushl $0
8010687f:	6a 00                	push   $0x0
  pushl $104
80106881:	6a 68                	push   $0x68
  jmp alltraps
80106883:	e9 2f f7 ff ff       	jmp    80105fb7 <alltraps>

80106888 <vector105>:
.globl vector105
vector105:
  pushl $0
80106888:	6a 00                	push   $0x0
  pushl $105
8010688a:	6a 69                	push   $0x69
  jmp alltraps
8010688c:	e9 26 f7 ff ff       	jmp    80105fb7 <alltraps>

80106891 <vector106>:
.globl vector106
vector106:
  pushl $0
80106891:	6a 00                	push   $0x0
  pushl $106
80106893:	6a 6a                	push   $0x6a
  jmp alltraps
80106895:	e9 1d f7 ff ff       	jmp    80105fb7 <alltraps>

8010689a <vector107>:
.globl vector107
vector107:
  pushl $0
8010689a:	6a 00                	push   $0x0
  pushl $107
8010689c:	6a 6b                	push   $0x6b
  jmp alltraps
8010689e:	e9 14 f7 ff ff       	jmp    80105fb7 <alltraps>

801068a3 <vector108>:
.globl vector108
vector108:
  pushl $0
801068a3:	6a 00                	push   $0x0
  pushl $108
801068a5:	6a 6c                	push   $0x6c
  jmp alltraps
801068a7:	e9 0b f7 ff ff       	jmp    80105fb7 <alltraps>

801068ac <vector109>:
.globl vector109
vector109:
  pushl $0
801068ac:	6a 00                	push   $0x0
  pushl $109
801068ae:	6a 6d                	push   $0x6d
  jmp alltraps
801068b0:	e9 02 f7 ff ff       	jmp    80105fb7 <alltraps>

801068b5 <vector110>:
.globl vector110
vector110:
  pushl $0
801068b5:	6a 00                	push   $0x0
  pushl $110
801068b7:	6a 6e                	push   $0x6e
  jmp alltraps
801068b9:	e9 f9 f6 ff ff       	jmp    80105fb7 <alltraps>

801068be <vector111>:
.globl vector111
vector111:
  pushl $0
801068be:	6a 00                	push   $0x0
  pushl $111
801068c0:	6a 6f                	push   $0x6f
  jmp alltraps
801068c2:	e9 f0 f6 ff ff       	jmp    80105fb7 <alltraps>

801068c7 <vector112>:
.globl vector112
vector112:
  pushl $0
801068c7:	6a 00                	push   $0x0
  pushl $112
801068c9:	6a 70                	push   $0x70
  jmp alltraps
801068cb:	e9 e7 f6 ff ff       	jmp    80105fb7 <alltraps>

801068d0 <vector113>:
.globl vector113
vector113:
  pushl $0
801068d0:	6a 00                	push   $0x0
  pushl $113
801068d2:	6a 71                	push   $0x71
  jmp alltraps
801068d4:	e9 de f6 ff ff       	jmp    80105fb7 <alltraps>

801068d9 <vector114>:
.globl vector114
vector114:
  pushl $0
801068d9:	6a 00                	push   $0x0
  pushl $114
801068db:	6a 72                	push   $0x72
  jmp alltraps
801068dd:	e9 d5 f6 ff ff       	jmp    80105fb7 <alltraps>

801068e2 <vector115>:
.globl vector115
vector115:
  pushl $0
801068e2:	6a 00                	push   $0x0
  pushl $115
801068e4:	6a 73                	push   $0x73
  jmp alltraps
801068e6:	e9 cc f6 ff ff       	jmp    80105fb7 <alltraps>

801068eb <vector116>:
.globl vector116
vector116:
  pushl $0
801068eb:	6a 00                	push   $0x0
  pushl $116
801068ed:	6a 74                	push   $0x74
  jmp alltraps
801068ef:	e9 c3 f6 ff ff       	jmp    80105fb7 <alltraps>

801068f4 <vector117>:
.globl vector117
vector117:
  pushl $0
801068f4:	6a 00                	push   $0x0
  pushl $117
801068f6:	6a 75                	push   $0x75
  jmp alltraps
801068f8:	e9 ba f6 ff ff       	jmp    80105fb7 <alltraps>

801068fd <vector118>:
.globl vector118
vector118:
  pushl $0
801068fd:	6a 00                	push   $0x0
  pushl $118
801068ff:	6a 76                	push   $0x76
  jmp alltraps
80106901:	e9 b1 f6 ff ff       	jmp    80105fb7 <alltraps>

80106906 <vector119>:
.globl vector119
vector119:
  pushl $0
80106906:	6a 00                	push   $0x0
  pushl $119
80106908:	6a 77                	push   $0x77
  jmp alltraps
8010690a:	e9 a8 f6 ff ff       	jmp    80105fb7 <alltraps>

8010690f <vector120>:
.globl vector120
vector120:
  pushl $0
8010690f:	6a 00                	push   $0x0
  pushl $120
80106911:	6a 78                	push   $0x78
  jmp alltraps
80106913:	e9 9f f6 ff ff       	jmp    80105fb7 <alltraps>

80106918 <vector121>:
.globl vector121
vector121:
  pushl $0
80106918:	6a 00                	push   $0x0
  pushl $121
8010691a:	6a 79                	push   $0x79
  jmp alltraps
8010691c:	e9 96 f6 ff ff       	jmp    80105fb7 <alltraps>

80106921 <vector122>:
.globl vector122
vector122:
  pushl $0
80106921:	6a 00                	push   $0x0
  pushl $122
80106923:	6a 7a                	push   $0x7a
  jmp alltraps
80106925:	e9 8d f6 ff ff       	jmp    80105fb7 <alltraps>

8010692a <vector123>:
.globl vector123
vector123:
  pushl $0
8010692a:	6a 00                	push   $0x0
  pushl $123
8010692c:	6a 7b                	push   $0x7b
  jmp alltraps
8010692e:	e9 84 f6 ff ff       	jmp    80105fb7 <alltraps>

80106933 <vector124>:
.globl vector124
vector124:
  pushl $0
80106933:	6a 00                	push   $0x0
  pushl $124
80106935:	6a 7c                	push   $0x7c
  jmp alltraps
80106937:	e9 7b f6 ff ff       	jmp    80105fb7 <alltraps>

8010693c <vector125>:
.globl vector125
vector125:
  pushl $0
8010693c:	6a 00                	push   $0x0
  pushl $125
8010693e:	6a 7d                	push   $0x7d
  jmp alltraps
80106940:	e9 72 f6 ff ff       	jmp    80105fb7 <alltraps>

80106945 <vector126>:
.globl vector126
vector126:
  pushl $0
80106945:	6a 00                	push   $0x0
  pushl $126
80106947:	6a 7e                	push   $0x7e
  jmp alltraps
80106949:	e9 69 f6 ff ff       	jmp    80105fb7 <alltraps>

8010694e <vector127>:
.globl vector127
vector127:
  pushl $0
8010694e:	6a 00                	push   $0x0
  pushl $127
80106950:	6a 7f                	push   $0x7f
  jmp alltraps
80106952:	e9 60 f6 ff ff       	jmp    80105fb7 <alltraps>

80106957 <vector128>:
.globl vector128
vector128:
  pushl $0
80106957:	6a 00                	push   $0x0
  pushl $128
80106959:	68 80 00 00 00       	push   $0x80
  jmp alltraps
8010695e:	e9 54 f6 ff ff       	jmp    80105fb7 <alltraps>

80106963 <vector129>:
.globl vector129
vector129:
  pushl $0
80106963:	6a 00                	push   $0x0
  pushl $129
80106965:	68 81 00 00 00       	push   $0x81
  jmp alltraps
8010696a:	e9 48 f6 ff ff       	jmp    80105fb7 <alltraps>

8010696f <vector130>:
.globl vector130
vector130:
  pushl $0
8010696f:	6a 00                	push   $0x0
  pushl $130
80106971:	68 82 00 00 00       	push   $0x82
  jmp alltraps
80106976:	e9 3c f6 ff ff       	jmp    80105fb7 <alltraps>

8010697b <vector131>:
.globl vector131
vector131:
  pushl $0
8010697b:	6a 00                	push   $0x0
  pushl $131
8010697d:	68 83 00 00 00       	push   $0x83
  jmp alltraps
80106982:	e9 30 f6 ff ff       	jmp    80105fb7 <alltraps>

80106987 <vector132>:
.globl vector132
vector132:
  pushl $0
80106987:	6a 00                	push   $0x0
  pushl $132
80106989:	68 84 00 00 00       	push   $0x84
  jmp alltraps
8010698e:	e9 24 f6 ff ff       	jmp    80105fb7 <alltraps>

80106993 <vector133>:
.globl vector133
vector133:
  pushl $0
80106993:	6a 00                	push   $0x0
  pushl $133
80106995:	68 85 00 00 00       	push   $0x85
  jmp alltraps
8010699a:	e9 18 f6 ff ff       	jmp    80105fb7 <alltraps>

8010699f <vector134>:
.globl vector134
vector134:
  pushl $0
8010699f:	6a 00                	push   $0x0
  pushl $134
801069a1:	68 86 00 00 00       	push   $0x86
  jmp alltraps
801069a6:	e9 0c f6 ff ff       	jmp    80105fb7 <alltraps>

801069ab <vector135>:
.globl vector135
vector135:
  pushl $0
801069ab:	6a 00                	push   $0x0
  pushl $135
801069ad:	68 87 00 00 00       	push   $0x87
  jmp alltraps
801069b2:	e9 00 f6 ff ff       	jmp    80105fb7 <alltraps>

801069b7 <vector136>:
.globl vector136
vector136:
  pushl $0
801069b7:	6a 00                	push   $0x0
  pushl $136
801069b9:	68 88 00 00 00       	push   $0x88
  jmp alltraps
801069be:	e9 f4 f5 ff ff       	jmp    80105fb7 <alltraps>

801069c3 <vector137>:
.globl vector137
vector137:
  pushl $0
801069c3:	6a 00                	push   $0x0
  pushl $137
801069c5:	68 89 00 00 00       	push   $0x89
  jmp alltraps
801069ca:	e9 e8 f5 ff ff       	jmp    80105fb7 <alltraps>

801069cf <vector138>:
.globl vector138
vector138:
  pushl $0
801069cf:	6a 00                	push   $0x0
  pushl $138
801069d1:	68 8a 00 00 00       	push   $0x8a
  jmp alltraps
801069d6:	e9 dc f5 ff ff       	jmp    80105fb7 <alltraps>

801069db <vector139>:
.globl vector139
vector139:
  pushl $0
801069db:	6a 00                	push   $0x0
  pushl $139
801069dd:	68 8b 00 00 00       	push   $0x8b
  jmp alltraps
801069e2:	e9 d0 f5 ff ff       	jmp    80105fb7 <alltraps>

801069e7 <vector140>:
.globl vector140
vector140:
  pushl $0
801069e7:	6a 00                	push   $0x0
  pushl $140
801069e9:	68 8c 00 00 00       	push   $0x8c
  jmp alltraps
801069ee:	e9 c4 f5 ff ff       	jmp    80105fb7 <alltraps>

801069f3 <vector141>:
.globl vector141
vector141:
  pushl $0
801069f3:	6a 00                	push   $0x0
  pushl $141
801069f5:	68 8d 00 00 00       	push   $0x8d
  jmp alltraps
801069fa:	e9 b8 f5 ff ff       	jmp    80105fb7 <alltraps>

801069ff <vector142>:
.globl vector142
vector142:
  pushl $0
801069ff:	6a 00                	push   $0x0
  pushl $142
80106a01:	68 8e 00 00 00       	push   $0x8e
  jmp alltraps
80106a06:	e9 ac f5 ff ff       	jmp    80105fb7 <alltraps>

80106a0b <vector143>:
.globl vector143
vector143:
  pushl $0
80106a0b:	6a 00                	push   $0x0
  pushl $143
80106a0d:	68 8f 00 00 00       	push   $0x8f
  jmp alltraps
80106a12:	e9 a0 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a17 <vector144>:
.globl vector144
vector144:
  pushl $0
80106a17:	6a 00                	push   $0x0
  pushl $144
80106a19:	68 90 00 00 00       	push   $0x90
  jmp alltraps
80106a1e:	e9 94 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a23 <vector145>:
.globl vector145
vector145:
  pushl $0
80106a23:	6a 00                	push   $0x0
  pushl $145
80106a25:	68 91 00 00 00       	push   $0x91
  jmp alltraps
80106a2a:	e9 88 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a2f <vector146>:
.globl vector146
vector146:
  pushl $0
80106a2f:	6a 00                	push   $0x0
  pushl $146
80106a31:	68 92 00 00 00       	push   $0x92
  jmp alltraps
80106a36:	e9 7c f5 ff ff       	jmp    80105fb7 <alltraps>

80106a3b <vector147>:
.globl vector147
vector147:
  pushl $0
80106a3b:	6a 00                	push   $0x0
  pushl $147
80106a3d:	68 93 00 00 00       	push   $0x93
  jmp alltraps
80106a42:	e9 70 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a47 <vector148>:
.globl vector148
vector148:
  pushl $0
80106a47:	6a 00                	push   $0x0
  pushl $148
80106a49:	68 94 00 00 00       	push   $0x94
  jmp alltraps
80106a4e:	e9 64 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a53 <vector149>:
.globl vector149
vector149:
  pushl $0
80106a53:	6a 00                	push   $0x0
  pushl $149
80106a55:	68 95 00 00 00       	push   $0x95
  jmp alltraps
80106a5a:	e9 58 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a5f <vector150>:
.globl vector150
vector150:
  pushl $0
80106a5f:	6a 00                	push   $0x0
  pushl $150
80106a61:	68 96 00 00 00       	push   $0x96
  jmp alltraps
80106a66:	e9 4c f5 ff ff       	jmp    80105fb7 <alltraps>

80106a6b <vector151>:
.globl vector151
vector151:
  pushl $0
80106a6b:	6a 00                	push   $0x0
  pushl $151
80106a6d:	68 97 00 00 00       	push   $0x97
  jmp alltraps
80106a72:	e9 40 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a77 <vector152>:
.globl vector152
vector152:
  pushl $0
80106a77:	6a 00                	push   $0x0
  pushl $152
80106a79:	68 98 00 00 00       	push   $0x98
  jmp alltraps
80106a7e:	e9 34 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a83 <vector153>:
.globl vector153
vector153:
  pushl $0
80106a83:	6a 00                	push   $0x0
  pushl $153
80106a85:	68 99 00 00 00       	push   $0x99
  jmp alltraps
80106a8a:	e9 28 f5 ff ff       	jmp    80105fb7 <alltraps>

80106a8f <vector154>:
.globl vector154
vector154:
  pushl $0
80106a8f:	6a 00                	push   $0x0
  pushl $154
80106a91:	68 9a 00 00 00       	push   $0x9a
  jmp alltraps
80106a96:	e9 1c f5 ff ff       	jmp    80105fb7 <alltraps>

80106a9b <vector155>:
.globl vector155
vector155:
  pushl $0
80106a9b:	6a 00                	push   $0x0
  pushl $155
80106a9d:	68 9b 00 00 00       	push   $0x9b
  jmp alltraps
80106aa2:	e9 10 f5 ff ff       	jmp    80105fb7 <alltraps>

80106aa7 <vector156>:
.globl vector156
vector156:
  pushl $0
80106aa7:	6a 00                	push   $0x0
  pushl $156
80106aa9:	68 9c 00 00 00       	push   $0x9c
  jmp alltraps
80106aae:	e9 04 f5 ff ff       	jmp    80105fb7 <alltraps>

80106ab3 <vector157>:
.globl vector157
vector157:
  pushl $0
80106ab3:	6a 00                	push   $0x0
  pushl $157
80106ab5:	68 9d 00 00 00       	push   $0x9d
  jmp alltraps
80106aba:	e9 f8 f4 ff ff       	jmp    80105fb7 <alltraps>

80106abf <vector158>:
.globl vector158
vector158:
  pushl $0
80106abf:	6a 00                	push   $0x0
  pushl $158
80106ac1:	68 9e 00 00 00       	push   $0x9e
  jmp alltraps
80106ac6:	e9 ec f4 ff ff       	jmp    80105fb7 <alltraps>

80106acb <vector159>:
.globl vector159
vector159:
  pushl $0
80106acb:	6a 00                	push   $0x0
  pushl $159
80106acd:	68 9f 00 00 00       	push   $0x9f
  jmp alltraps
80106ad2:	e9 e0 f4 ff ff       	jmp    80105fb7 <alltraps>

80106ad7 <vector160>:
.globl vector160
vector160:
  pushl $0
80106ad7:	6a 00                	push   $0x0
  pushl $160
80106ad9:	68 a0 00 00 00       	push   $0xa0
  jmp alltraps
80106ade:	e9 d4 f4 ff ff       	jmp    80105fb7 <alltraps>

80106ae3 <vector161>:
.globl vector161
vector161:
  pushl $0
80106ae3:	6a 00                	push   $0x0
  pushl $161
80106ae5:	68 a1 00 00 00       	push   $0xa1
  jmp alltraps
80106aea:	e9 c8 f4 ff ff       	jmp    80105fb7 <alltraps>

80106aef <vector162>:
.globl vector162
vector162:
  pushl $0
80106aef:	6a 00                	push   $0x0
  pushl $162
80106af1:	68 a2 00 00 00       	push   $0xa2
  jmp alltraps
80106af6:	e9 bc f4 ff ff       	jmp    80105fb7 <alltraps>

80106afb <vector163>:
.globl vector163
vector163:
  pushl $0
80106afb:	6a 00                	push   $0x0
  pushl $163
80106afd:	68 a3 00 00 00       	push   $0xa3
  jmp alltraps
80106b02:	e9 b0 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b07 <vector164>:
.globl vector164
vector164:
  pushl $0
80106b07:	6a 00                	push   $0x0
  pushl $164
80106b09:	68 a4 00 00 00       	push   $0xa4
  jmp alltraps
80106b0e:	e9 a4 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b13 <vector165>:
.globl vector165
vector165:
  pushl $0
80106b13:	6a 00                	push   $0x0
  pushl $165
80106b15:	68 a5 00 00 00       	push   $0xa5
  jmp alltraps
80106b1a:	e9 98 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b1f <vector166>:
.globl vector166
vector166:
  pushl $0
80106b1f:	6a 00                	push   $0x0
  pushl $166
80106b21:	68 a6 00 00 00       	push   $0xa6
  jmp alltraps
80106b26:	e9 8c f4 ff ff       	jmp    80105fb7 <alltraps>

80106b2b <vector167>:
.globl vector167
vector167:
  pushl $0
80106b2b:	6a 00                	push   $0x0
  pushl $167
80106b2d:	68 a7 00 00 00       	push   $0xa7
  jmp alltraps
80106b32:	e9 80 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b37 <vector168>:
.globl vector168
vector168:
  pushl $0
80106b37:	6a 00                	push   $0x0
  pushl $168
80106b39:	68 a8 00 00 00       	push   $0xa8
  jmp alltraps
80106b3e:	e9 74 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b43 <vector169>:
.globl vector169
vector169:
  pushl $0
80106b43:	6a 00                	push   $0x0
  pushl $169
80106b45:	68 a9 00 00 00       	push   $0xa9
  jmp alltraps
80106b4a:	e9 68 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b4f <vector170>:
.globl vector170
vector170:
  pushl $0
80106b4f:	6a 00                	push   $0x0
  pushl $170
80106b51:	68 aa 00 00 00       	push   $0xaa
  jmp alltraps
80106b56:	e9 5c f4 ff ff       	jmp    80105fb7 <alltraps>

80106b5b <vector171>:
.globl vector171
vector171:
  pushl $0
80106b5b:	6a 00                	push   $0x0
  pushl $171
80106b5d:	68 ab 00 00 00       	push   $0xab
  jmp alltraps
80106b62:	e9 50 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b67 <vector172>:
.globl vector172
vector172:
  pushl $0
80106b67:	6a 00                	push   $0x0
  pushl $172
80106b69:	68 ac 00 00 00       	push   $0xac
  jmp alltraps
80106b6e:	e9 44 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b73 <vector173>:
.globl vector173
vector173:
  pushl $0
80106b73:	6a 00                	push   $0x0
  pushl $173
80106b75:	68 ad 00 00 00       	push   $0xad
  jmp alltraps
80106b7a:	e9 38 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b7f <vector174>:
.globl vector174
vector174:
  pushl $0
80106b7f:	6a 00                	push   $0x0
  pushl $174
80106b81:	68 ae 00 00 00       	push   $0xae
  jmp alltraps
80106b86:	e9 2c f4 ff ff       	jmp    80105fb7 <alltraps>

80106b8b <vector175>:
.globl vector175
vector175:
  pushl $0
80106b8b:	6a 00                	push   $0x0
  pushl $175
80106b8d:	68 af 00 00 00       	push   $0xaf
  jmp alltraps
80106b92:	e9 20 f4 ff ff       	jmp    80105fb7 <alltraps>

80106b97 <vector176>:
.globl vector176
vector176:
  pushl $0
80106b97:	6a 00                	push   $0x0
  pushl $176
80106b99:	68 b0 00 00 00       	push   $0xb0
  jmp alltraps
80106b9e:	e9 14 f4 ff ff       	jmp    80105fb7 <alltraps>

80106ba3 <vector177>:
.globl vector177
vector177:
  pushl $0
80106ba3:	6a 00                	push   $0x0
  pushl $177
80106ba5:	68 b1 00 00 00       	push   $0xb1
  jmp alltraps
80106baa:	e9 08 f4 ff ff       	jmp    80105fb7 <alltraps>

80106baf <vector178>:
.globl vector178
vector178:
  pushl $0
80106baf:	6a 00                	push   $0x0
  pushl $178
80106bb1:	68 b2 00 00 00       	push   $0xb2
  jmp alltraps
80106bb6:	e9 fc f3 ff ff       	jmp    80105fb7 <alltraps>

80106bbb <vector179>:
.globl vector179
vector179:
  pushl $0
80106bbb:	6a 00                	push   $0x0
  pushl $179
80106bbd:	68 b3 00 00 00       	push   $0xb3
  jmp alltraps
80106bc2:	e9 f0 f3 ff ff       	jmp    80105fb7 <alltraps>

80106bc7 <vector180>:
.globl vector180
vector180:
  pushl $0
80106bc7:	6a 00                	push   $0x0
  pushl $180
80106bc9:	68 b4 00 00 00       	push   $0xb4
  jmp alltraps
80106bce:	e9 e4 f3 ff ff       	jmp    80105fb7 <alltraps>

80106bd3 <vector181>:
.globl vector181
vector181:
  pushl $0
80106bd3:	6a 00                	push   $0x0
  pushl $181
80106bd5:	68 b5 00 00 00       	push   $0xb5
  jmp alltraps
80106bda:	e9 d8 f3 ff ff       	jmp    80105fb7 <alltraps>

80106bdf <vector182>:
.globl vector182
vector182:
  pushl $0
80106bdf:	6a 00                	push   $0x0
  pushl $182
80106be1:	68 b6 00 00 00       	push   $0xb6
  jmp alltraps
80106be6:	e9 cc f3 ff ff       	jmp    80105fb7 <alltraps>

80106beb <vector183>:
.globl vector183
vector183:
  pushl $0
80106beb:	6a 00                	push   $0x0
  pushl $183
80106bed:	68 b7 00 00 00       	push   $0xb7
  jmp alltraps
80106bf2:	e9 c0 f3 ff ff       	jmp    80105fb7 <alltraps>

80106bf7 <vector184>:
.globl vector184
vector184:
  pushl $0
80106bf7:	6a 00                	push   $0x0
  pushl $184
80106bf9:	68 b8 00 00 00       	push   $0xb8
  jmp alltraps
80106bfe:	e9 b4 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c03 <vector185>:
.globl vector185
vector185:
  pushl $0
80106c03:	6a 00                	push   $0x0
  pushl $185
80106c05:	68 b9 00 00 00       	push   $0xb9
  jmp alltraps
80106c0a:	e9 a8 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c0f <vector186>:
.globl vector186
vector186:
  pushl $0
80106c0f:	6a 00                	push   $0x0
  pushl $186
80106c11:	68 ba 00 00 00       	push   $0xba
  jmp alltraps
80106c16:	e9 9c f3 ff ff       	jmp    80105fb7 <alltraps>

80106c1b <vector187>:
.globl vector187
vector187:
  pushl $0
80106c1b:	6a 00                	push   $0x0
  pushl $187
80106c1d:	68 bb 00 00 00       	push   $0xbb
  jmp alltraps
80106c22:	e9 90 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c27 <vector188>:
.globl vector188
vector188:
  pushl $0
80106c27:	6a 00                	push   $0x0
  pushl $188
80106c29:	68 bc 00 00 00       	push   $0xbc
  jmp alltraps
80106c2e:	e9 84 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c33 <vector189>:
.globl vector189
vector189:
  pushl $0
80106c33:	6a 00                	push   $0x0
  pushl $189
80106c35:	68 bd 00 00 00       	push   $0xbd
  jmp alltraps
80106c3a:	e9 78 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c3f <vector190>:
.globl vector190
vector190:
  pushl $0
80106c3f:	6a 00                	push   $0x0
  pushl $190
80106c41:	68 be 00 00 00       	push   $0xbe
  jmp alltraps
80106c46:	e9 6c f3 ff ff       	jmp    80105fb7 <alltraps>

80106c4b <vector191>:
.globl vector191
vector191:
  pushl $0
80106c4b:	6a 00                	push   $0x0
  pushl $191
80106c4d:	68 bf 00 00 00       	push   $0xbf
  jmp alltraps
80106c52:	e9 60 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c57 <vector192>:
.globl vector192
vector192:
  pushl $0
80106c57:	6a 00                	push   $0x0
  pushl $192
80106c59:	68 c0 00 00 00       	push   $0xc0
  jmp alltraps
80106c5e:	e9 54 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c63 <vector193>:
.globl vector193
vector193:
  pushl $0
80106c63:	6a 00                	push   $0x0
  pushl $193
80106c65:	68 c1 00 00 00       	push   $0xc1
  jmp alltraps
80106c6a:	e9 48 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c6f <vector194>:
.globl vector194
vector194:
  pushl $0
80106c6f:	6a 00                	push   $0x0
  pushl $194
80106c71:	68 c2 00 00 00       	push   $0xc2
  jmp alltraps
80106c76:	e9 3c f3 ff ff       	jmp    80105fb7 <alltraps>

80106c7b <vector195>:
.globl vector195
vector195:
  pushl $0
80106c7b:	6a 00                	push   $0x0
  pushl $195
80106c7d:	68 c3 00 00 00       	push   $0xc3
  jmp alltraps
80106c82:	e9 30 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c87 <vector196>:
.globl vector196
vector196:
  pushl $0
80106c87:	6a 00                	push   $0x0
  pushl $196
80106c89:	68 c4 00 00 00       	push   $0xc4
  jmp alltraps
80106c8e:	e9 24 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c93 <vector197>:
.globl vector197
vector197:
  pushl $0
80106c93:	6a 00                	push   $0x0
  pushl $197
80106c95:	68 c5 00 00 00       	push   $0xc5
  jmp alltraps
80106c9a:	e9 18 f3 ff ff       	jmp    80105fb7 <alltraps>

80106c9f <vector198>:
.globl vector198
vector198:
  pushl $0
80106c9f:	6a 00                	push   $0x0
  pushl $198
80106ca1:	68 c6 00 00 00       	push   $0xc6
  jmp alltraps
80106ca6:	e9 0c f3 ff ff       	jmp    80105fb7 <alltraps>

80106cab <vector199>:
.globl vector199
vector199:
  pushl $0
80106cab:	6a 00                	push   $0x0
  pushl $199
80106cad:	68 c7 00 00 00       	push   $0xc7
  jmp alltraps
80106cb2:	e9 00 f3 ff ff       	jmp    80105fb7 <alltraps>

80106cb7 <vector200>:
.globl vector200
vector200:
  pushl $0
80106cb7:	6a 00                	push   $0x0
  pushl $200
80106cb9:	68 c8 00 00 00       	push   $0xc8
  jmp alltraps
80106cbe:	e9 f4 f2 ff ff       	jmp    80105fb7 <alltraps>

80106cc3 <vector201>:
.globl vector201
vector201:
  pushl $0
80106cc3:	6a 00                	push   $0x0
  pushl $201
80106cc5:	68 c9 00 00 00       	push   $0xc9
  jmp alltraps
80106cca:	e9 e8 f2 ff ff       	jmp    80105fb7 <alltraps>

80106ccf <vector202>:
.globl vector202
vector202:
  pushl $0
80106ccf:	6a 00                	push   $0x0
  pushl $202
80106cd1:	68 ca 00 00 00       	push   $0xca
  jmp alltraps
80106cd6:	e9 dc f2 ff ff       	jmp    80105fb7 <alltraps>

80106cdb <vector203>:
.globl vector203
vector203:
  pushl $0
80106cdb:	6a 00                	push   $0x0
  pushl $203
80106cdd:	68 cb 00 00 00       	push   $0xcb
  jmp alltraps
80106ce2:	e9 d0 f2 ff ff       	jmp    80105fb7 <alltraps>

80106ce7 <vector204>:
.globl vector204
vector204:
  pushl $0
80106ce7:	6a 00                	push   $0x0
  pushl $204
80106ce9:	68 cc 00 00 00       	push   $0xcc
  jmp alltraps
80106cee:	e9 c4 f2 ff ff       	jmp    80105fb7 <alltraps>

80106cf3 <vector205>:
.globl vector205
vector205:
  pushl $0
80106cf3:	6a 00                	push   $0x0
  pushl $205
80106cf5:	68 cd 00 00 00       	push   $0xcd
  jmp alltraps
80106cfa:	e9 b8 f2 ff ff       	jmp    80105fb7 <alltraps>

80106cff <vector206>:
.globl vector206
vector206:
  pushl $0
80106cff:	6a 00                	push   $0x0
  pushl $206
80106d01:	68 ce 00 00 00       	push   $0xce
  jmp alltraps
80106d06:	e9 ac f2 ff ff       	jmp    80105fb7 <alltraps>

80106d0b <vector207>:
.globl vector207
vector207:
  pushl $0
80106d0b:	6a 00                	push   $0x0
  pushl $207
80106d0d:	68 cf 00 00 00       	push   $0xcf
  jmp alltraps
80106d12:	e9 a0 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d17 <vector208>:
.globl vector208
vector208:
  pushl $0
80106d17:	6a 00                	push   $0x0
  pushl $208
80106d19:	68 d0 00 00 00       	push   $0xd0
  jmp alltraps
80106d1e:	e9 94 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d23 <vector209>:
.globl vector209
vector209:
  pushl $0
80106d23:	6a 00                	push   $0x0
  pushl $209
80106d25:	68 d1 00 00 00       	push   $0xd1
  jmp alltraps
80106d2a:	e9 88 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d2f <vector210>:
.globl vector210
vector210:
  pushl $0
80106d2f:	6a 00                	push   $0x0
  pushl $210
80106d31:	68 d2 00 00 00       	push   $0xd2
  jmp alltraps
80106d36:	e9 7c f2 ff ff       	jmp    80105fb7 <alltraps>

80106d3b <vector211>:
.globl vector211
vector211:
  pushl $0
80106d3b:	6a 00                	push   $0x0
  pushl $211
80106d3d:	68 d3 00 00 00       	push   $0xd3
  jmp alltraps
80106d42:	e9 70 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d47 <vector212>:
.globl vector212
vector212:
  pushl $0
80106d47:	6a 00                	push   $0x0
  pushl $212
80106d49:	68 d4 00 00 00       	push   $0xd4
  jmp alltraps
80106d4e:	e9 64 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d53 <vector213>:
.globl vector213
vector213:
  pushl $0
80106d53:	6a 00                	push   $0x0
  pushl $213
80106d55:	68 d5 00 00 00       	push   $0xd5
  jmp alltraps
80106d5a:	e9 58 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d5f <vector214>:
.globl vector214
vector214:
  pushl $0
80106d5f:	6a 00                	push   $0x0
  pushl $214
80106d61:	68 d6 00 00 00       	push   $0xd6
  jmp alltraps
80106d66:	e9 4c f2 ff ff       	jmp    80105fb7 <alltraps>

80106d6b <vector215>:
.globl vector215
vector215:
  pushl $0
80106d6b:	6a 00                	push   $0x0
  pushl $215
80106d6d:	68 d7 00 00 00       	push   $0xd7
  jmp alltraps
80106d72:	e9 40 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d77 <vector216>:
.globl vector216
vector216:
  pushl $0
80106d77:	6a 00                	push   $0x0
  pushl $216
80106d79:	68 d8 00 00 00       	push   $0xd8
  jmp alltraps
80106d7e:	e9 34 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d83 <vector217>:
.globl vector217
vector217:
  pushl $0
80106d83:	6a 00                	push   $0x0
  pushl $217
80106d85:	68 d9 00 00 00       	push   $0xd9
  jmp alltraps
80106d8a:	e9 28 f2 ff ff       	jmp    80105fb7 <alltraps>

80106d8f <vector218>:
.globl vector218
vector218:
  pushl $0
80106d8f:	6a 00                	push   $0x0
  pushl $218
80106d91:	68 da 00 00 00       	push   $0xda
  jmp alltraps
80106d96:	e9 1c f2 ff ff       	jmp    80105fb7 <alltraps>

80106d9b <vector219>:
.globl vector219
vector219:
  pushl $0
80106d9b:	6a 00                	push   $0x0
  pushl $219
80106d9d:	68 db 00 00 00       	push   $0xdb
  jmp alltraps
80106da2:	e9 10 f2 ff ff       	jmp    80105fb7 <alltraps>

80106da7 <vector220>:
.globl vector220
vector220:
  pushl $0
80106da7:	6a 00                	push   $0x0
  pushl $220
80106da9:	68 dc 00 00 00       	push   $0xdc
  jmp alltraps
80106dae:	e9 04 f2 ff ff       	jmp    80105fb7 <alltraps>

80106db3 <vector221>:
.globl vector221
vector221:
  pushl $0
80106db3:	6a 00                	push   $0x0
  pushl $221
80106db5:	68 dd 00 00 00       	push   $0xdd
  jmp alltraps
80106dba:	e9 f8 f1 ff ff       	jmp    80105fb7 <alltraps>

80106dbf <vector222>:
.globl vector222
vector222:
  pushl $0
80106dbf:	6a 00                	push   $0x0
  pushl $222
80106dc1:	68 de 00 00 00       	push   $0xde
  jmp alltraps
80106dc6:	e9 ec f1 ff ff       	jmp    80105fb7 <alltraps>

80106dcb <vector223>:
.globl vector223
vector223:
  pushl $0
80106dcb:	6a 00                	push   $0x0
  pushl $223
80106dcd:	68 df 00 00 00       	push   $0xdf
  jmp alltraps
80106dd2:	e9 e0 f1 ff ff       	jmp    80105fb7 <alltraps>

80106dd7 <vector224>:
.globl vector224
vector224:
  pushl $0
80106dd7:	6a 00                	push   $0x0
  pushl $224
80106dd9:	68 e0 00 00 00       	push   $0xe0
  jmp alltraps
80106dde:	e9 d4 f1 ff ff       	jmp    80105fb7 <alltraps>

80106de3 <vector225>:
.globl vector225
vector225:
  pushl $0
80106de3:	6a 00                	push   $0x0
  pushl $225
80106de5:	68 e1 00 00 00       	push   $0xe1
  jmp alltraps
80106dea:	e9 c8 f1 ff ff       	jmp    80105fb7 <alltraps>

80106def <vector226>:
.globl vector226
vector226:
  pushl $0
80106def:	6a 00                	push   $0x0
  pushl $226
80106df1:	68 e2 00 00 00       	push   $0xe2
  jmp alltraps
80106df6:	e9 bc f1 ff ff       	jmp    80105fb7 <alltraps>

80106dfb <vector227>:
.globl vector227
vector227:
  pushl $0
80106dfb:	6a 00                	push   $0x0
  pushl $227
80106dfd:	68 e3 00 00 00       	push   $0xe3
  jmp alltraps
80106e02:	e9 b0 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e07 <vector228>:
.globl vector228
vector228:
  pushl $0
80106e07:	6a 00                	push   $0x0
  pushl $228
80106e09:	68 e4 00 00 00       	push   $0xe4
  jmp alltraps
80106e0e:	e9 a4 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e13 <vector229>:
.globl vector229
vector229:
  pushl $0
80106e13:	6a 00                	push   $0x0
  pushl $229
80106e15:	68 e5 00 00 00       	push   $0xe5
  jmp alltraps
80106e1a:	e9 98 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e1f <vector230>:
.globl vector230
vector230:
  pushl $0
80106e1f:	6a 00                	push   $0x0
  pushl $230
80106e21:	68 e6 00 00 00       	push   $0xe6
  jmp alltraps
80106e26:	e9 8c f1 ff ff       	jmp    80105fb7 <alltraps>

80106e2b <vector231>:
.globl vector231
vector231:
  pushl $0
80106e2b:	6a 00                	push   $0x0
  pushl $231
80106e2d:	68 e7 00 00 00       	push   $0xe7
  jmp alltraps
80106e32:	e9 80 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e37 <vector232>:
.globl vector232
vector232:
  pushl $0
80106e37:	6a 00                	push   $0x0
  pushl $232
80106e39:	68 e8 00 00 00       	push   $0xe8
  jmp alltraps
80106e3e:	e9 74 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e43 <vector233>:
.globl vector233
vector233:
  pushl $0
80106e43:	6a 00                	push   $0x0
  pushl $233
80106e45:	68 e9 00 00 00       	push   $0xe9
  jmp alltraps
80106e4a:	e9 68 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e4f <vector234>:
.globl vector234
vector234:
  pushl $0
80106e4f:	6a 00                	push   $0x0
  pushl $234
80106e51:	68 ea 00 00 00       	push   $0xea
  jmp alltraps
80106e56:	e9 5c f1 ff ff       	jmp    80105fb7 <alltraps>

80106e5b <vector235>:
.globl vector235
vector235:
  pushl $0
80106e5b:	6a 00                	push   $0x0
  pushl $235
80106e5d:	68 eb 00 00 00       	push   $0xeb
  jmp alltraps
80106e62:	e9 50 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e67 <vector236>:
.globl vector236
vector236:
  pushl $0
80106e67:	6a 00                	push   $0x0
  pushl $236
80106e69:	68 ec 00 00 00       	push   $0xec
  jmp alltraps
80106e6e:	e9 44 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e73 <vector237>:
.globl vector237
vector237:
  pushl $0
80106e73:	6a 00                	push   $0x0
  pushl $237
80106e75:	68 ed 00 00 00       	push   $0xed
  jmp alltraps
80106e7a:	e9 38 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e7f <vector238>:
.globl vector238
vector238:
  pushl $0
80106e7f:	6a 00                	push   $0x0
  pushl $238
80106e81:	68 ee 00 00 00       	push   $0xee
  jmp alltraps
80106e86:	e9 2c f1 ff ff       	jmp    80105fb7 <alltraps>

80106e8b <vector239>:
.globl vector239
vector239:
  pushl $0
80106e8b:	6a 00                	push   $0x0
  pushl $239
80106e8d:	68 ef 00 00 00       	push   $0xef
  jmp alltraps
80106e92:	e9 20 f1 ff ff       	jmp    80105fb7 <alltraps>

80106e97 <vector240>:
.globl vector240
vector240:
  pushl $0
80106e97:	6a 00                	push   $0x0
  pushl $240
80106e99:	68 f0 00 00 00       	push   $0xf0
  jmp alltraps
80106e9e:	e9 14 f1 ff ff       	jmp    80105fb7 <alltraps>

80106ea3 <vector241>:
.globl vector241
vector241:
  pushl $0
80106ea3:	6a 00                	push   $0x0
  pushl $241
80106ea5:	68 f1 00 00 00       	push   $0xf1
  jmp alltraps
80106eaa:	e9 08 f1 ff ff       	jmp    80105fb7 <alltraps>

80106eaf <vector242>:
.globl vector242
vector242:
  pushl $0
80106eaf:	6a 00                	push   $0x0
  pushl $242
80106eb1:	68 f2 00 00 00       	push   $0xf2
  jmp alltraps
80106eb6:	e9 fc f0 ff ff       	jmp    80105fb7 <alltraps>

80106ebb <vector243>:
.globl vector243
vector243:
  pushl $0
80106ebb:	6a 00                	push   $0x0
  pushl $243
80106ebd:	68 f3 00 00 00       	push   $0xf3
  jmp alltraps
80106ec2:	e9 f0 f0 ff ff       	jmp    80105fb7 <alltraps>

80106ec7 <vector244>:
.globl vector244
vector244:
  pushl $0
80106ec7:	6a 00                	push   $0x0
  pushl $244
80106ec9:	68 f4 00 00 00       	push   $0xf4
  jmp alltraps
80106ece:	e9 e4 f0 ff ff       	jmp    80105fb7 <alltraps>

80106ed3 <vector245>:
.globl vector245
vector245:
  pushl $0
80106ed3:	6a 00                	push   $0x0
  pushl $245
80106ed5:	68 f5 00 00 00       	push   $0xf5
  jmp alltraps
80106eda:	e9 d8 f0 ff ff       	jmp    80105fb7 <alltraps>

80106edf <vector246>:
.globl vector246
vector246:
  pushl $0
80106edf:	6a 00                	push   $0x0
  pushl $246
80106ee1:	68 f6 00 00 00       	push   $0xf6
  jmp alltraps
80106ee6:	e9 cc f0 ff ff       	jmp    80105fb7 <alltraps>

80106eeb <vector247>:
.globl vector247
vector247:
  pushl $0
80106eeb:	6a 00                	push   $0x0
  pushl $247
80106eed:	68 f7 00 00 00       	push   $0xf7
  jmp alltraps
80106ef2:	e9 c0 f0 ff ff       	jmp    80105fb7 <alltraps>

80106ef7 <vector248>:
.globl vector248
vector248:
  pushl $0
80106ef7:	6a 00                	push   $0x0
  pushl $248
80106ef9:	68 f8 00 00 00       	push   $0xf8
  jmp alltraps
80106efe:	e9 b4 f0 ff ff       	jmp    80105fb7 <alltraps>

80106f03 <vector249>:
.globl vector249
vector249:
  pushl $0
80106f03:	6a 00                	push   $0x0
  pushl $249
80106f05:	68 f9 00 00 00       	push   $0xf9
  jmp alltraps
80106f0a:	e9 a8 f0 ff ff       	jmp    80105fb7 <alltraps>

80106f0f <vector250>:
.globl vector250
vector250:
  pushl $0
80106f0f:	6a 00                	push   $0x0
  pushl $250
80106f11:	68 fa 00 00 00       	push   $0xfa
  jmp alltraps
80106f16:	e9 9c f0 ff ff       	jmp    80105fb7 <alltraps>

80106f1b <vector251>:
.globl vector251
vector251:
  pushl $0
80106f1b:	6a 00                	push   $0x0
  pushl $251
80106f1d:	68 fb 00 00 00       	push   $0xfb
  jmp alltraps
80106f22:	e9 90 f0 ff ff       	jmp    80105fb7 <alltraps>

80106f27 <vector252>:
.globl vector252
vector252:
  pushl $0
80106f27:	6a 00                	push   $0x0
  pushl $252
80106f29:	68 fc 00 00 00       	push   $0xfc
  jmp alltraps
80106f2e:	e9 84 f0 ff ff       	jmp    80105fb7 <alltraps>

80106f33 <vector253>:
.globl vector253
vector253:
  pushl $0
80106f33:	6a 00                	push   $0x0
  pushl $253
80106f35:	68 fd 00 00 00       	push   $0xfd
  jmp alltraps
80106f3a:	e9 78 f0 ff ff       	jmp    80105fb7 <alltraps>

80106f3f <vector254>:
.globl vector254
vector254:
  pushl $0
80106f3f:	6a 00                	push   $0x0
  pushl $254
80106f41:	68 fe 00 00 00       	push   $0xfe
  jmp alltraps
80106f46:	e9 6c f0 ff ff       	jmp    80105fb7 <alltraps>

80106f4b <vector255>:
.globl vector255
vector255:
  pushl $0
80106f4b:	6a 00                	push   $0x0
  pushl $255
80106f4d:	68 ff 00 00 00       	push   $0xff
  jmp alltraps
80106f52:	e9 60 f0 ff ff       	jmp    80105fb7 <alltraps>
80106f57:	66 90                	xchg   %ax,%ax
80106f59:	66 90                	xchg   %ax,%ax
80106f5b:	66 90                	xchg   %ax,%ax
80106f5d:	66 90                	xchg   %ax,%ax
80106f5f:	90                   	nop

80106f60 <deallocuvm.part.0>:
// Deallocate user pages to bring the process size from oldsz to
// newsz.  oldsz and newsz need not be page-aligned, nor does newsz
// need to be less than oldsz.  oldsz can be larger than the actual
// process size.  Returns the new process size.
int
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106f60:	55                   	push   %ebp
80106f61:	89 e5                	mov    %esp,%ebp
80106f63:	57                   	push   %edi
80106f64:	56                   	push   %esi
80106f65:	53                   	push   %ebx
  uint a, pa;

  if(newsz >= oldsz)
    return oldsz;

  a = PGROUNDUP(newsz);
80106f66:	8d 99 ff 0f 00 00    	lea    0xfff(%ecx),%ebx
80106f6c:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
deallocuvm(pde_t *pgdir, uint oldsz, uint newsz)
80106f72:	83 ec 1c             	sub    $0x1c,%esp
80106f75:	89 4d e0             	mov    %ecx,-0x20(%ebp)
  for(; a  < oldsz; a += PGSIZE){
80106f78:	39 d3                	cmp    %edx,%ebx
80106f7a:	73 49                	jae    80106fc5 <deallocuvm.part.0+0x65>
80106f7c:	89 c7                	mov    %eax,%edi
80106f7e:	eb 0c                	jmp    80106f8c <deallocuvm.part.0+0x2c>
    pte = walkpgdir(pgdir, (char*)a, 0);
    if(!pte)
      a = PGADDR(PDX(a) + 1, 0, 0) - PGSIZE;
80106f80:	83 c0 01             	add    $0x1,%eax
80106f83:	c1 e0 16             	shl    $0x16,%eax
80106f86:	89 c3                	mov    %eax,%ebx
  for(; a  < oldsz; a += PGSIZE){
80106f88:	39 da                	cmp    %ebx,%edx
80106f8a:	76 39                	jbe    80106fc5 <deallocuvm.part.0+0x65>
  pde = &pgdir[PDX(va)];
80106f8c:	89 d8                	mov    %ebx,%eax
80106f8e:	c1 e8 16             	shr    $0x16,%eax
  if(*pde & PTE_P){
80106f91:	8b 0c 87             	mov    (%edi,%eax,4),%ecx
80106f94:	f6 c1 01             	test   $0x1,%cl
80106f97:	74 e7                	je     80106f80 <deallocuvm.part.0+0x20>
  return &pgtab[PTX(va)];
80106f99:	89 de                	mov    %ebx,%esi
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80106f9b:	81 e1 00 f0 ff ff    	and    $0xfffff000,%ecx
  return &pgtab[PTX(va)];
80106fa1:	c1 ee 0a             	shr    $0xa,%esi
80106fa4:	81 e6 fc 0f 00 00    	and    $0xffc,%esi
80106faa:	8d b4 31 00 00 00 80 	lea    -0x80000000(%ecx,%esi,1),%esi
    if(!pte)
80106fb1:	85 f6                	test   %esi,%esi
80106fb3:	74 cb                	je     80106f80 <deallocuvm.part.0+0x20>
    else if((*pte & PTE_P) != 0){
80106fb5:	8b 06                	mov    (%esi),%eax
80106fb7:	a8 01                	test   $0x1,%al
80106fb9:	75 15                	jne    80106fd0 <deallocuvm.part.0+0x70>
  for(; a  < oldsz; a += PGSIZE){
80106fbb:	81 c3 00 10 00 00    	add    $0x1000,%ebx
80106fc1:	39 da                	cmp    %ebx,%edx
80106fc3:	77 c7                	ja     80106f8c <deallocuvm.part.0+0x2c>
      kfree(v);
      *pte = 0;
    }
  }
  return newsz;
}
80106fc5:	8b 45 e0             	mov    -0x20(%ebp),%eax
80106fc8:	8d 65 f4             	lea    -0xc(%ebp),%esp
80106fcb:	5b                   	pop    %ebx
80106fcc:	5e                   	pop    %esi
80106fcd:	5f                   	pop    %edi
80106fce:	5d                   	pop    %ebp
80106fcf:	c3                   	ret    
      if(pa == 0)
80106fd0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
80106fd5:	74 25                	je     80106ffc <deallocuvm.part.0+0x9c>
      kfree(v);
80106fd7:	83 ec 0c             	sub    $0xc,%esp
      char *v = P2V(pa);
80106fda:	05 00 00 00 80       	add    $0x80000000,%eax
80106fdf:	89 55 e4             	mov    %edx,-0x1c(%ebp)
  for(; a  < oldsz; a += PGSIZE){
80106fe2:	81 c3 00 10 00 00    	add    $0x1000,%ebx
      kfree(v);
80106fe8:	50                   	push   %eax
80106fe9:	e8 f2 b4 ff ff       	call   801024e0 <kfree>
      *pte = 0;
80106fee:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
  for(; a  < oldsz; a += PGSIZE){
80106ff4:	8b 55 e4             	mov    -0x1c(%ebp),%edx
80106ff7:	83 c4 10             	add    $0x10,%esp
80106ffa:	eb 8c                	jmp    80106f88 <deallocuvm.part.0+0x28>
        panic("kfree");
80106ffc:	83 ec 0c             	sub    $0xc,%esp
80106fff:	68 a6 7b 10 80       	push   $0x80107ba6
80107004:	e8 77 93 ff ff       	call   80100380 <panic>
80107009:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80107010 <mappages>:
{
80107010:	55                   	push   %ebp
80107011:	89 e5                	mov    %esp,%ebp
80107013:	57                   	push   %edi
80107014:	56                   	push   %esi
80107015:	53                   	push   %ebx
  a = (char*)PGROUNDDOWN((uint)va);
80107016:	89 d3                	mov    %edx,%ebx
80107018:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
{
8010701e:	83 ec 1c             	sub    $0x1c,%esp
80107021:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  last = (char*)PGROUNDDOWN(((uint)va) + size - 1);
80107024:	8d 44 0a ff          	lea    -0x1(%edx,%ecx,1),%eax
80107028:	25 00 f0 ff ff       	and    $0xfffff000,%eax
8010702d:	89 45 dc             	mov    %eax,-0x24(%ebp)
80107030:	8b 45 08             	mov    0x8(%ebp),%eax
80107033:	29 d8                	sub    %ebx,%eax
80107035:	89 45 e0             	mov    %eax,-0x20(%ebp)
80107038:	eb 3d                	jmp    80107077 <mappages+0x67>
8010703a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  return &pgtab[PTX(va)];
80107040:	89 da                	mov    %ebx,%edx
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80107042:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  return &pgtab[PTX(va)];
80107047:	c1 ea 0a             	shr    $0xa,%edx
8010704a:	81 e2 fc 0f 00 00    	and    $0xffc,%edx
80107050:	8d 84 10 00 00 00 80 	lea    -0x80000000(%eax,%edx,1),%eax
    if((pte = walkpgdir(pgdir, a, 1)) == 0)
80107057:	85 c0                	test   %eax,%eax
80107059:	74 75                	je     801070d0 <mappages+0xc0>
    if(*pte & PTE_P)
8010705b:	f6 00 01             	testb  $0x1,(%eax)
8010705e:	0f 85 86 00 00 00    	jne    801070ea <mappages+0xda>
    *pte = pa | perm | PTE_P;
80107064:	0b 75 0c             	or     0xc(%ebp),%esi
80107067:	83 ce 01             	or     $0x1,%esi
8010706a:	89 30                	mov    %esi,(%eax)
    if(a == last)
8010706c:	3b 5d dc             	cmp    -0x24(%ebp),%ebx
8010706f:	74 6f                	je     801070e0 <mappages+0xd0>
    a += PGSIZE;
80107071:	81 c3 00 10 00 00    	add    $0x1000,%ebx
  for(;;){
80107077:	8b 45 e0             	mov    -0x20(%ebp),%eax
  pde = &pgdir[PDX(va)];
8010707a:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
8010707d:	8d 34 18             	lea    (%eax,%ebx,1),%esi
80107080:	89 d8                	mov    %ebx,%eax
80107082:	c1 e8 16             	shr    $0x16,%eax
80107085:	8d 3c 81             	lea    (%ecx,%eax,4),%edi
  if(*pde & PTE_P){
80107088:	8b 07                	mov    (%edi),%eax
8010708a:	a8 01                	test   $0x1,%al
8010708c:	75 b2                	jne    80107040 <mappages+0x30>
    if(!alloc || (pgtab = (pte_t*)kalloc()) == 0)
8010708e:	e8 0d b6 ff ff       	call   801026a0 <kalloc>
80107093:	85 c0                	test   %eax,%eax
80107095:	74 39                	je     801070d0 <mappages+0xc0>
    memset(pgtab, 0, PGSIZE);
80107097:	83 ec 04             	sub    $0x4,%esp
8010709a:	89 45 d8             	mov    %eax,-0x28(%ebp)
8010709d:	68 00 10 00 00       	push   $0x1000
801070a2:	6a 00                	push   $0x0
801070a4:	50                   	push   %eax
801070a5:	e8 66 db ff ff       	call   80104c10 <memset>
    *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
801070aa:	8b 55 d8             	mov    -0x28(%ebp),%edx
  return &pgtab[PTX(va)];
801070ad:	83 c4 10             	add    $0x10,%esp
    *pde = V2P(pgtab) | PTE_P | PTE_W | PTE_U;
801070b0:	8d 82 00 00 00 80    	lea    -0x80000000(%edx),%eax
801070b6:	83 c8 07             	or     $0x7,%eax
801070b9:	89 07                	mov    %eax,(%edi)
  return &pgtab[PTX(va)];
801070bb:	89 d8                	mov    %ebx,%eax
801070bd:	c1 e8 0a             	shr    $0xa,%eax
801070c0:	25 fc 0f 00 00       	and    $0xffc,%eax
801070c5:	01 d0                	add    %edx,%eax
801070c7:	eb 92                	jmp    8010705b <mappages+0x4b>
801070c9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
}
801070d0:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
801070d3:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
801070d8:	5b                   	pop    %ebx
801070d9:	5e                   	pop    %esi
801070da:	5f                   	pop    %edi
801070db:	5d                   	pop    %ebp
801070dc:	c3                   	ret    
801070dd:	8d 76 00             	lea    0x0(%esi),%esi
801070e0:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
801070e3:	31 c0                	xor    %eax,%eax
}
801070e5:	5b                   	pop    %ebx
801070e6:	5e                   	pop    %esi
801070e7:	5f                   	pop    %edi
801070e8:	5d                   	pop    %ebp
801070e9:	c3                   	ret    
      panic("remap");
801070ea:	83 ec 0c             	sub    $0xc,%esp
801070ed:	68 48 82 10 80       	push   $0x80108248
801070f2:	e8 89 92 ff ff       	call   80100380 <panic>
801070f7:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801070fe:	66 90                	xchg   %ax,%ax

80107100 <seginit>:
{
80107100:	55                   	push   %ebp
80107101:	89 e5                	mov    %esp,%ebp
80107103:	83 ec 18             	sub    $0x18,%esp
  c = &cpus[cpuid()];
80107106:	e8 75 c8 ff ff       	call   80103980 <cpuid>
  pd[0] = size-1;
8010710b:	ba 2f 00 00 00       	mov    $0x2f,%edx
80107110:	69 c0 b0 00 00 00    	imul   $0xb0,%eax,%eax
80107116:	66 89 55 f2          	mov    %dx,-0xe(%ebp)
  c->gdt[SEG_KCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, 0);
8010711a:	c7 80 18 28 11 80 ff 	movl   $0xffff,-0x7feed7e8(%eax)
80107121:	ff 00 00 
80107124:	c7 80 1c 28 11 80 00 	movl   $0xcf9a00,-0x7feed7e4(%eax)
8010712b:	9a cf 00 
  c->gdt[SEG_KDATA] = SEG(STA_W, 0, 0xffffffff, 0);
8010712e:	c7 80 20 28 11 80 ff 	movl   $0xffff,-0x7feed7e0(%eax)
80107135:	ff 00 00 
80107138:	c7 80 24 28 11 80 00 	movl   $0xcf9200,-0x7feed7dc(%eax)
8010713f:	92 cf 00 
  c->gdt[SEG_UCODE] = SEG(STA_X|STA_R, 0, 0xffffffff, DPL_USER);
80107142:	c7 80 28 28 11 80 ff 	movl   $0xffff,-0x7feed7d8(%eax)
80107149:	ff 00 00 
8010714c:	c7 80 2c 28 11 80 00 	movl   $0xcffa00,-0x7feed7d4(%eax)
80107153:	fa cf 00 
  c->gdt[SEG_UDATA] = SEG(STA_W, 0, 0xffffffff, DPL_USER);
80107156:	c7 80 30 28 11 80 ff 	movl   $0xffff,-0x7feed7d0(%eax)
8010715d:	ff 00 00 
80107160:	c7 80 34 28 11 80 00 	movl   $0xcff200,-0x7feed7cc(%eax)
80107167:	f2 cf 00 
  lgdt(c->gdt, sizeof(c->gdt));
8010716a:	05 10 28 11 80       	add    $0x80112810,%eax
  pd[1] = (uint)p;
8010716f:	66 89 45 f4          	mov    %ax,-0xc(%ebp)
  pd[2] = (uint)p >> 16;
80107173:	c1 e8 10             	shr    $0x10,%eax
80107176:	66 89 45 f6          	mov    %ax,-0xa(%ebp)
  asm volatile("lgdt (%0)" : : "r" (pd));
8010717a:	8d 45 f2             	lea    -0xe(%ebp),%eax
8010717d:	0f 01 10             	lgdtl  (%eax)
}
80107180:	c9                   	leave  
80107181:	c3                   	ret    
80107182:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80107189:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80107190 <switchkvm>:
  lcr3(V2P(kpgdir));   // switch to the kernel page table
80107190:	a1 c4 d6 11 80       	mov    0x8011d6c4,%eax
80107195:	05 00 00 00 80       	add    $0x80000000,%eax
}

static inline void
lcr3(uint val)
{
  asm volatile("movl %0,%%cr3" : : "r" (val));
8010719a:	0f 22 d8             	mov    %eax,%cr3
}
8010719d:	c3                   	ret    
8010719e:	66 90                	xchg   %ax,%ax

801071a0 <switchuvm>:
{
801071a0:	55                   	push   %ebp
801071a1:	89 e5                	mov    %esp,%ebp
801071a3:	57                   	push   %edi
801071a4:	56                   	push   %esi
801071a5:	53                   	push   %ebx
801071a6:	83 ec 1c             	sub    $0x1c,%esp
801071a9:	8b 75 08             	mov    0x8(%ebp),%esi
  if(p == 0)
801071ac:	85 f6                	test   %esi,%esi
801071ae:	0f 84 cb 00 00 00    	je     8010727f <switchuvm+0xdf>
  if(p->kstack == 0)
801071b4:	8b 46 08             	mov    0x8(%esi),%eax
801071b7:	85 c0                	test   %eax,%eax
801071b9:	0f 84 da 00 00 00    	je     80107299 <switchuvm+0xf9>
  if(p->pgdir == 0)
801071bf:	8b 46 04             	mov    0x4(%esi),%eax
801071c2:	85 c0                	test   %eax,%eax
801071c4:	0f 84 c2 00 00 00    	je     8010728c <switchuvm+0xec>
  pushcli();
801071ca:	e8 81 d8 ff ff       	call   80104a50 <pushcli>
  mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
801071cf:	e8 4c c7 ff ff       	call   80103920 <mycpu>
801071d4:	89 c3                	mov    %eax,%ebx
801071d6:	e8 45 c7 ff ff       	call   80103920 <mycpu>
801071db:	89 c7                	mov    %eax,%edi
801071dd:	e8 3e c7 ff ff       	call   80103920 <mycpu>
801071e2:	83 c7 08             	add    $0x8,%edi
801071e5:	89 45 e4             	mov    %eax,-0x1c(%ebp)
801071e8:	e8 33 c7 ff ff       	call   80103920 <mycpu>
801071ed:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
801071f0:	ba 67 00 00 00       	mov    $0x67,%edx
801071f5:	66 89 bb 9a 00 00 00 	mov    %di,0x9a(%ebx)
801071fc:	83 c0 08             	add    $0x8,%eax
801071ff:	66 89 93 98 00 00 00 	mov    %dx,0x98(%ebx)
  mycpu()->ts.iomb = (ushort) 0xFFFF;
80107206:	bf ff ff ff ff       	mov    $0xffffffff,%edi
  mycpu()->gdt[SEG_TSS] = SEG16(STS_T32A, &mycpu()->ts,
8010720b:	83 c1 08             	add    $0x8,%ecx
8010720e:	c1 e8 18             	shr    $0x18,%eax
80107211:	c1 e9 10             	shr    $0x10,%ecx
80107214:	88 83 9f 00 00 00    	mov    %al,0x9f(%ebx)
8010721a:	88 8b 9c 00 00 00    	mov    %cl,0x9c(%ebx)
80107220:	b9 99 40 00 00       	mov    $0x4099,%ecx
80107225:	66 89 8b 9d 00 00 00 	mov    %cx,0x9d(%ebx)
  mycpu()->ts.ss0 = SEG_KDATA << 3;
8010722c:	bb 10 00 00 00       	mov    $0x10,%ebx
  mycpu()->gdt[SEG_TSS].s = 0;
80107231:	e8 ea c6 ff ff       	call   80103920 <mycpu>
80107236:	80 a0 9d 00 00 00 ef 	andb   $0xef,0x9d(%eax)
  mycpu()->ts.ss0 = SEG_KDATA << 3;
8010723d:	e8 de c6 ff ff       	call   80103920 <mycpu>
80107242:	66 89 58 10          	mov    %bx,0x10(%eax)
  mycpu()->ts.esp0 = (uint)p->kstack + KSTACKSIZE;
80107246:	8b 5e 08             	mov    0x8(%esi),%ebx
80107249:	81 c3 00 10 00 00    	add    $0x1000,%ebx
8010724f:	e8 cc c6 ff ff       	call   80103920 <mycpu>
80107254:	89 58 0c             	mov    %ebx,0xc(%eax)
  mycpu()->ts.iomb = (ushort) 0xFFFF;
80107257:	e8 c4 c6 ff ff       	call   80103920 <mycpu>
8010725c:	66 89 78 6e          	mov    %di,0x6e(%eax)
  asm volatile("ltr %0" : : "r" (sel));
80107260:	b8 28 00 00 00       	mov    $0x28,%eax
80107265:	0f 00 d8             	ltr    %ax
  lcr3(V2P(p->pgdir));  // switch to process's address space
80107268:	8b 46 04             	mov    0x4(%esi),%eax
8010726b:	05 00 00 00 80       	add    $0x80000000,%eax
  asm volatile("movl %0,%%cr3" : : "r" (val));
80107270:	0f 22 d8             	mov    %eax,%cr3
}
80107273:	8d 65 f4             	lea    -0xc(%ebp),%esp
80107276:	5b                   	pop    %ebx
80107277:	5e                   	pop    %esi
80107278:	5f                   	pop    %edi
80107279:	5d                   	pop    %ebp
  popcli();
8010727a:	e9 e1 d8 ff ff       	jmp    80104b60 <popcli>
    panic("switchuvm: no process");
8010727f:	83 ec 0c             	sub    $0xc,%esp
80107282:	68 4e 82 10 80       	push   $0x8010824e
80107287:	e8 f4 90 ff ff       	call   80100380 <panic>
    panic("switchuvm: no pgdir");
8010728c:	83 ec 0c             	sub    $0xc,%esp
8010728f:	68 79 82 10 80       	push   $0x80108279
80107294:	e8 e7 90 ff ff       	call   80100380 <panic>
    panic("switchuvm: no kstack");
80107299:	83 ec 0c             	sub    $0xc,%esp
8010729c:	68 64 82 10 80       	push   $0x80108264
801072a1:	e8 da 90 ff ff       	call   80100380 <panic>
801072a6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801072ad:	8d 76 00             	lea    0x0(%esi),%esi

801072b0 <inituvm>:
{
801072b0:	55                   	push   %ebp
801072b1:	89 e5                	mov    %esp,%ebp
801072b3:	57                   	push   %edi
801072b4:	56                   	push   %esi
801072b5:	53                   	push   %ebx
801072b6:	83 ec 1c             	sub    $0x1c,%esp
801072b9:	8b 45 0c             	mov    0xc(%ebp),%eax
801072bc:	8b 75 10             	mov    0x10(%ebp),%esi
801072bf:	8b 7d 08             	mov    0x8(%ebp),%edi
801072c2:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  if(sz >= PGSIZE)
801072c5:	81 fe ff 0f 00 00    	cmp    $0xfff,%esi
801072cb:	77 4b                	ja     80107318 <inituvm+0x68>
  mem = kalloc();
801072cd:	e8 ce b3 ff ff       	call   801026a0 <kalloc>
  memset(mem, 0, PGSIZE);
801072d2:	83 ec 04             	sub    $0x4,%esp
801072d5:	68 00 10 00 00       	push   $0x1000
  mem = kalloc();
801072da:	89 c3                	mov    %eax,%ebx
  memset(mem, 0, PGSIZE);
801072dc:	6a 00                	push   $0x0
801072de:	50                   	push   %eax
801072df:	e8 2c d9 ff ff       	call   80104c10 <memset>
  mappages(pgdir, 0, PGSIZE, V2P(mem), PTE_W|PTE_U);
801072e4:	58                   	pop    %eax
801072e5:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
801072eb:	5a                   	pop    %edx
801072ec:	6a 06                	push   $0x6
801072ee:	b9 00 10 00 00       	mov    $0x1000,%ecx
801072f3:	31 d2                	xor    %edx,%edx
801072f5:	50                   	push   %eax
801072f6:	89 f8                	mov    %edi,%eax
801072f8:	e8 13 fd ff ff       	call   80107010 <mappages>
  memmove(mem, init, sz);
801072fd:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80107300:	89 75 10             	mov    %esi,0x10(%ebp)
80107303:	83 c4 10             	add    $0x10,%esp
80107306:	89 5d 08             	mov    %ebx,0x8(%ebp)
80107309:	89 45 0c             	mov    %eax,0xc(%ebp)
}
8010730c:	8d 65 f4             	lea    -0xc(%ebp),%esp
8010730f:	5b                   	pop    %ebx
80107310:	5e                   	pop    %esi
80107311:	5f                   	pop    %edi
80107312:	5d                   	pop    %ebp
  memmove(mem, init, sz);
80107313:	e9 98 d9 ff ff       	jmp    80104cb0 <memmove>
    panic("inituvm: more than a page");
80107318:	83 ec 0c             	sub    $0xc,%esp
8010731b:	68 8d 82 10 80       	push   $0x8010828d
80107320:	e8 5b 90 ff ff       	call   80100380 <panic>
80107325:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010732c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80107330 <loaduvm>:
{
80107330:	55                   	push   %ebp
80107331:	89 e5                	mov    %esp,%ebp
80107333:	57                   	push   %edi
80107334:	56                   	push   %esi
80107335:	53                   	push   %ebx
80107336:	83 ec 1c             	sub    $0x1c,%esp
80107339:	8b 45 0c             	mov    0xc(%ebp),%eax
8010733c:	8b 75 18             	mov    0x18(%ebp),%esi
  if((uint) addr % PGSIZE != 0)
8010733f:	a9 ff 0f 00 00       	test   $0xfff,%eax
80107344:	0f 85 bb 00 00 00    	jne    80107405 <loaduvm+0xd5>
  for(i = 0; i < sz; i += PGSIZE){
8010734a:	01 f0                	add    %esi,%eax
8010734c:	89 f3                	mov    %esi,%ebx
8010734e:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(readi(ip, P2V(pa), offset+i, n) != n)
80107351:	8b 45 14             	mov    0x14(%ebp),%eax
80107354:	01 f0                	add    %esi,%eax
80107356:	89 45 e0             	mov    %eax,-0x20(%ebp)
  for(i = 0; i < sz; i += PGSIZE){
80107359:	85 f6                	test   %esi,%esi
8010735b:	0f 84 87 00 00 00    	je     801073e8 <loaduvm+0xb8>
80107361:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  pde = &pgdir[PDX(va)];
80107368:	8b 45 e4             	mov    -0x1c(%ebp),%eax
  if(*pde & PTE_P){
8010736b:	8b 4d 08             	mov    0x8(%ebp),%ecx
8010736e:	29 d8                	sub    %ebx,%eax
  pde = &pgdir[PDX(va)];
80107370:	89 c2                	mov    %eax,%edx
80107372:	c1 ea 16             	shr    $0x16,%edx
  if(*pde & PTE_P){
80107375:	8b 14 91             	mov    (%ecx,%edx,4),%edx
80107378:	f6 c2 01             	test   $0x1,%dl
8010737b:	75 13                	jne    80107390 <loaduvm+0x60>
      panic("loaduvm: address should exist");
8010737d:	83 ec 0c             	sub    $0xc,%esp
80107380:	68 a7 82 10 80       	push   $0x801082a7
80107385:	e8 f6 8f ff ff       	call   80100380 <panic>
8010738a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  return &pgtab[PTX(va)];
80107390:	c1 e8 0a             	shr    $0xa,%eax
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80107393:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
  return &pgtab[PTX(va)];
80107399:	25 fc 0f 00 00       	and    $0xffc,%eax
8010739e:	8d 84 02 00 00 00 80 	lea    -0x80000000(%edx,%eax,1),%eax
    if((pte = walkpgdir(pgdir, addr+i, 0)) == 0)
801073a5:	85 c0                	test   %eax,%eax
801073a7:	74 d4                	je     8010737d <loaduvm+0x4d>
    pa = PTE_ADDR(*pte);
801073a9:	8b 00                	mov    (%eax),%eax
    if(readi(ip, P2V(pa), offset+i, n) != n)
801073ab:	8b 4d e0             	mov    -0x20(%ebp),%ecx
    if(sz - i < PGSIZE)
801073ae:	bf 00 10 00 00       	mov    $0x1000,%edi
    pa = PTE_ADDR(*pte);
801073b3:	25 00 f0 ff ff       	and    $0xfffff000,%eax
    if(sz - i < PGSIZE)
801073b8:	81 fb ff 0f 00 00    	cmp    $0xfff,%ebx
801073be:	0f 46 fb             	cmovbe %ebx,%edi
    if(readi(ip, P2V(pa), offset+i, n) != n)
801073c1:	29 d9                	sub    %ebx,%ecx
801073c3:	05 00 00 00 80       	add    $0x80000000,%eax
801073c8:	57                   	push   %edi
801073c9:	51                   	push   %ecx
801073ca:	50                   	push   %eax
801073cb:	ff 75 10             	push   0x10(%ebp)
801073ce:	e8 dd a6 ff ff       	call   80101ab0 <readi>
801073d3:	83 c4 10             	add    $0x10,%esp
801073d6:	39 f8                	cmp    %edi,%eax
801073d8:	75 1e                	jne    801073f8 <loaduvm+0xc8>
  for(i = 0; i < sz; i += PGSIZE){
801073da:	81 eb 00 10 00 00    	sub    $0x1000,%ebx
801073e0:	89 f0                	mov    %esi,%eax
801073e2:	29 d8                	sub    %ebx,%eax
801073e4:	39 c6                	cmp    %eax,%esi
801073e6:	77 80                	ja     80107368 <loaduvm+0x38>
}
801073e8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
801073eb:	31 c0                	xor    %eax,%eax
}
801073ed:	5b                   	pop    %ebx
801073ee:	5e                   	pop    %esi
801073ef:	5f                   	pop    %edi
801073f0:	5d                   	pop    %ebp
801073f1:	c3                   	ret    
801073f2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
801073f8:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
801073fb:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80107400:	5b                   	pop    %ebx
80107401:	5e                   	pop    %esi
80107402:	5f                   	pop    %edi
80107403:	5d                   	pop    %ebp
80107404:	c3                   	ret    
    panic("loaduvm: addr must be page aligned");
80107405:	83 ec 0c             	sub    $0xc,%esp
80107408:	68 48 83 10 80       	push   $0x80108348
8010740d:	e8 6e 8f ff ff       	call   80100380 <panic>
80107412:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
80107419:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi

80107420 <allocuvm>:
{
80107420:	55                   	push   %ebp
80107421:	89 e5                	mov    %esp,%ebp
80107423:	57                   	push   %edi
80107424:	56                   	push   %esi
80107425:	53                   	push   %ebx
80107426:	83 ec 1c             	sub    $0x1c,%esp
  if(newsz >= KERNBASE)
80107429:	8b 45 10             	mov    0x10(%ebp),%eax
{
8010742c:	8b 7d 08             	mov    0x8(%ebp),%edi
  if(newsz >= KERNBASE)
8010742f:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80107432:	85 c0                	test   %eax,%eax
80107434:	0f 88 b6 00 00 00    	js     801074f0 <allocuvm+0xd0>
  if(newsz < oldsz)
8010743a:	3b 45 0c             	cmp    0xc(%ebp),%eax
    return oldsz;
8010743d:	8b 45 0c             	mov    0xc(%ebp),%eax
  if(newsz < oldsz)
80107440:	0f 82 9a 00 00 00    	jb     801074e0 <allocuvm+0xc0>
  a = PGROUNDUP(oldsz);
80107446:	8d b0 ff 0f 00 00    	lea    0xfff(%eax),%esi
8010744c:	81 e6 00 f0 ff ff    	and    $0xfffff000,%esi
  for(; a < newsz; a += PGSIZE){
80107452:	39 75 10             	cmp    %esi,0x10(%ebp)
80107455:	77 44                	ja     8010749b <allocuvm+0x7b>
80107457:	e9 87 00 00 00       	jmp    801074e3 <allocuvm+0xc3>
8010745c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    memset(mem, 0, PGSIZE);
80107460:	83 ec 04             	sub    $0x4,%esp
80107463:	68 00 10 00 00       	push   $0x1000
80107468:	6a 00                	push   $0x0
8010746a:	50                   	push   %eax
8010746b:	e8 a0 d7 ff ff       	call   80104c10 <memset>
    if(mappages(pgdir, (char*)a, PGSIZE, V2P(mem), PTE_W|PTE_U) < 0){
80107470:	58                   	pop    %eax
80107471:	8d 83 00 00 00 80    	lea    -0x80000000(%ebx),%eax
80107477:	5a                   	pop    %edx
80107478:	6a 06                	push   $0x6
8010747a:	b9 00 10 00 00       	mov    $0x1000,%ecx
8010747f:	89 f2                	mov    %esi,%edx
80107481:	50                   	push   %eax
80107482:	89 f8                	mov    %edi,%eax
80107484:	e8 87 fb ff ff       	call   80107010 <mappages>
80107489:	83 c4 10             	add    $0x10,%esp
8010748c:	85 c0                	test   %eax,%eax
8010748e:	78 78                	js     80107508 <allocuvm+0xe8>
  for(; a < newsz; a += PGSIZE){
80107490:	81 c6 00 10 00 00    	add    $0x1000,%esi
80107496:	39 75 10             	cmp    %esi,0x10(%ebp)
80107499:	76 48                	jbe    801074e3 <allocuvm+0xc3>
    mem = kalloc();
8010749b:	e8 00 b2 ff ff       	call   801026a0 <kalloc>
801074a0:	89 c3                	mov    %eax,%ebx
    if(mem == 0){
801074a2:	85 c0                	test   %eax,%eax
801074a4:	75 ba                	jne    80107460 <allocuvm+0x40>
      cprintf("allocuvm out of memory\n");
801074a6:	83 ec 0c             	sub    $0xc,%esp
801074a9:	68 c5 82 10 80       	push   $0x801082c5
801074ae:	e8 ed 91 ff ff       	call   801006a0 <cprintf>
  if(newsz >= oldsz)
801074b3:	8b 45 0c             	mov    0xc(%ebp),%eax
801074b6:	83 c4 10             	add    $0x10,%esp
801074b9:	39 45 10             	cmp    %eax,0x10(%ebp)
801074bc:	74 32                	je     801074f0 <allocuvm+0xd0>
801074be:	8b 55 10             	mov    0x10(%ebp),%edx
801074c1:	89 c1                	mov    %eax,%ecx
801074c3:	89 f8                	mov    %edi,%eax
801074c5:	e8 96 fa ff ff       	call   80106f60 <deallocuvm.part.0>
      return 0;
801074ca:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
}
801074d1:	8b 45 e4             	mov    -0x1c(%ebp),%eax
801074d4:	8d 65 f4             	lea    -0xc(%ebp),%esp
801074d7:	5b                   	pop    %ebx
801074d8:	5e                   	pop    %esi
801074d9:	5f                   	pop    %edi
801074da:	5d                   	pop    %ebp
801074db:	c3                   	ret    
801074dc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
    return oldsz;
801074e0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
}
801074e3:	8b 45 e4             	mov    -0x1c(%ebp),%eax
801074e6:	8d 65 f4             	lea    -0xc(%ebp),%esp
801074e9:	5b                   	pop    %ebx
801074ea:	5e                   	pop    %esi
801074eb:	5f                   	pop    %edi
801074ec:	5d                   	pop    %ebp
801074ed:	c3                   	ret    
801074ee:	66 90                	xchg   %ax,%ax
    return 0;
801074f0:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
}
801074f7:	8b 45 e4             	mov    -0x1c(%ebp),%eax
801074fa:	8d 65 f4             	lea    -0xc(%ebp),%esp
801074fd:	5b                   	pop    %ebx
801074fe:	5e                   	pop    %esi
801074ff:	5f                   	pop    %edi
80107500:	5d                   	pop    %ebp
80107501:	c3                   	ret    
80107502:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
      cprintf("allocuvm out of memory (2)\n");
80107508:	83 ec 0c             	sub    $0xc,%esp
8010750b:	68 dd 82 10 80       	push   $0x801082dd
80107510:	e8 8b 91 ff ff       	call   801006a0 <cprintf>
  if(newsz >= oldsz)
80107515:	8b 45 0c             	mov    0xc(%ebp),%eax
80107518:	83 c4 10             	add    $0x10,%esp
8010751b:	39 45 10             	cmp    %eax,0x10(%ebp)
8010751e:	74 0c                	je     8010752c <allocuvm+0x10c>
80107520:	8b 55 10             	mov    0x10(%ebp),%edx
80107523:	89 c1                	mov    %eax,%ecx
80107525:	89 f8                	mov    %edi,%eax
80107527:	e8 34 fa ff ff       	call   80106f60 <deallocuvm.part.0>
      kfree(mem);
8010752c:	83 ec 0c             	sub    $0xc,%esp
8010752f:	53                   	push   %ebx
80107530:	e8 ab af ff ff       	call   801024e0 <kfree>
      return 0;
80107535:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
8010753c:	83 c4 10             	add    $0x10,%esp
}
8010753f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
80107542:	8d 65 f4             	lea    -0xc(%ebp),%esp
80107545:	5b                   	pop    %ebx
80107546:	5e                   	pop    %esi
80107547:	5f                   	pop    %edi
80107548:	5d                   	pop    %ebp
80107549:	c3                   	ret    
8010754a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

80107550 <deallocuvm>:
{
80107550:	55                   	push   %ebp
80107551:	89 e5                	mov    %esp,%ebp
80107553:	8b 55 0c             	mov    0xc(%ebp),%edx
80107556:	8b 4d 10             	mov    0x10(%ebp),%ecx
80107559:	8b 45 08             	mov    0x8(%ebp),%eax
  if(newsz >= oldsz)
8010755c:	39 d1                	cmp    %edx,%ecx
8010755e:	73 10                	jae    80107570 <deallocuvm+0x20>
}
80107560:	5d                   	pop    %ebp
80107561:	e9 fa f9 ff ff       	jmp    80106f60 <deallocuvm.part.0>
80107566:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010756d:	8d 76 00             	lea    0x0(%esi),%esi
80107570:	89 d0                	mov    %edx,%eax
80107572:	5d                   	pop    %ebp
80107573:	c3                   	ret    
80107574:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010757b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010757f:	90                   	nop

80107580 <freevm>:

// Free a page table and all the physical memory pages
// in the user part.
void
freevm(pde_t *pgdir)
{
80107580:	55                   	push   %ebp
80107581:	89 e5                	mov    %esp,%ebp
80107583:	57                   	push   %edi
80107584:	56                   	push   %esi
80107585:	53                   	push   %ebx
80107586:	83 ec 0c             	sub    $0xc,%esp
80107589:	8b 75 08             	mov    0x8(%ebp),%esi
  uint i;

  if(pgdir == 0)
8010758c:	85 f6                	test   %esi,%esi
8010758e:	74 59                	je     801075e9 <freevm+0x69>
  if(newsz >= oldsz)
80107590:	31 c9                	xor    %ecx,%ecx
80107592:	ba 00 00 00 80       	mov    $0x80000000,%edx
80107597:	89 f0                	mov    %esi,%eax
80107599:	89 f3                	mov    %esi,%ebx
8010759b:	e8 c0 f9 ff ff       	call   80106f60 <deallocuvm.part.0>
    panic("freevm: no pgdir");
  deallocuvm(pgdir, KERNBASE, 0);
  for(i = 0; i < NPDENTRIES; i++){
801075a0:	8d be 00 10 00 00    	lea    0x1000(%esi),%edi
801075a6:	eb 0f                	jmp    801075b7 <freevm+0x37>
801075a8:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801075af:	90                   	nop
801075b0:	83 c3 04             	add    $0x4,%ebx
801075b3:	39 df                	cmp    %ebx,%edi
801075b5:	74 23                	je     801075da <freevm+0x5a>
    if(pgdir[i] & PTE_P){
801075b7:	8b 03                	mov    (%ebx),%eax
801075b9:	a8 01                	test   $0x1,%al
801075bb:	74 f3                	je     801075b0 <freevm+0x30>
      char * v = P2V(PTE_ADDR(pgdir[i]));
801075bd:	25 00 f0 ff ff       	and    $0xfffff000,%eax
      kfree(v);
801075c2:	83 ec 0c             	sub    $0xc,%esp
  for(i = 0; i < NPDENTRIES; i++){
801075c5:	83 c3 04             	add    $0x4,%ebx
      char * v = P2V(PTE_ADDR(pgdir[i]));
801075c8:	05 00 00 00 80       	add    $0x80000000,%eax
      kfree(v);
801075cd:	50                   	push   %eax
801075ce:	e8 0d af ff ff       	call   801024e0 <kfree>
801075d3:	83 c4 10             	add    $0x10,%esp
  for(i = 0; i < NPDENTRIES; i++){
801075d6:	39 df                	cmp    %ebx,%edi
801075d8:	75 dd                	jne    801075b7 <freevm+0x37>
    }
  }
  kfree((char*)pgdir);
801075da:	89 75 08             	mov    %esi,0x8(%ebp)
}
801075dd:	8d 65 f4             	lea    -0xc(%ebp),%esp
801075e0:	5b                   	pop    %ebx
801075e1:	5e                   	pop    %esi
801075e2:	5f                   	pop    %edi
801075e3:	5d                   	pop    %ebp
  kfree((char*)pgdir);
801075e4:	e9 f7 ae ff ff       	jmp    801024e0 <kfree>
    panic("freevm: no pgdir");
801075e9:	83 ec 0c             	sub    $0xc,%esp
801075ec:	68 f9 82 10 80       	push   $0x801082f9
801075f1:	e8 8a 8d ff ff       	call   80100380 <panic>
801075f6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801075fd:	8d 76 00             	lea    0x0(%esi),%esi

80107600 <setupkvm>:
{
80107600:	55                   	push   %ebp
80107601:	89 e5                	mov    %esp,%ebp
80107603:	56                   	push   %esi
80107604:	53                   	push   %ebx
  if((pgdir = (pde_t*)kalloc()) == 0)
80107605:	e8 96 b0 ff ff       	call   801026a0 <kalloc>
8010760a:	89 c6                	mov    %eax,%esi
8010760c:	85 c0                	test   %eax,%eax
8010760e:	74 42                	je     80107652 <setupkvm+0x52>
  memset(pgdir, 0, PGSIZE);
80107610:	83 ec 04             	sub    $0x4,%esp
  for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107613:	bb 20 b4 10 80       	mov    $0x8010b420,%ebx
  memset(pgdir, 0, PGSIZE);
80107618:	68 00 10 00 00       	push   $0x1000
8010761d:	6a 00                	push   $0x0
8010761f:	50                   	push   %eax
80107620:	e8 eb d5 ff ff       	call   80104c10 <memset>
80107625:	83 c4 10             	add    $0x10,%esp
                (uint)k->phys_start, k->perm) < 0) {
80107628:	8b 43 04             	mov    0x4(%ebx),%eax
    if(mappages(pgdir, k->virt, k->phys_end - k->phys_start,
8010762b:	83 ec 08             	sub    $0x8,%esp
8010762e:	8b 4b 08             	mov    0x8(%ebx),%ecx
80107631:	ff 73 0c             	push   0xc(%ebx)
80107634:	8b 13                	mov    (%ebx),%edx
80107636:	50                   	push   %eax
80107637:	29 c1                	sub    %eax,%ecx
80107639:	89 f0                	mov    %esi,%eax
8010763b:	e8 d0 f9 ff ff       	call   80107010 <mappages>
80107640:	83 c4 10             	add    $0x10,%esp
80107643:	85 c0                	test   %eax,%eax
80107645:	78 19                	js     80107660 <setupkvm+0x60>
  for(k = kmap; k < &kmap[NELEM(kmap)]; k++)
80107647:	83 c3 10             	add    $0x10,%ebx
8010764a:	81 fb 60 b4 10 80    	cmp    $0x8010b460,%ebx
80107650:	75 d6                	jne    80107628 <setupkvm+0x28>
}
80107652:	8d 65 f8             	lea    -0x8(%ebp),%esp
80107655:	89 f0                	mov    %esi,%eax
80107657:	5b                   	pop    %ebx
80107658:	5e                   	pop    %esi
80107659:	5d                   	pop    %ebp
8010765a:	c3                   	ret    
8010765b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010765f:	90                   	nop
      freevm(pgdir);
80107660:	83 ec 0c             	sub    $0xc,%esp
80107663:	56                   	push   %esi
      return 0;
80107664:	31 f6                	xor    %esi,%esi
      freevm(pgdir);
80107666:	e8 15 ff ff ff       	call   80107580 <freevm>
      return 0;
8010766b:	83 c4 10             	add    $0x10,%esp
}
8010766e:	8d 65 f8             	lea    -0x8(%ebp),%esp
80107671:	89 f0                	mov    %esi,%eax
80107673:	5b                   	pop    %ebx
80107674:	5e                   	pop    %esi
80107675:	5d                   	pop    %ebp
80107676:	c3                   	ret    
80107677:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010767e:	66 90                	xchg   %ax,%ax

80107680 <kvmalloc>:
{
80107680:	55                   	push   %ebp
80107681:	89 e5                	mov    %esp,%ebp
80107683:	83 ec 08             	sub    $0x8,%esp
  kpgdir = setupkvm();
80107686:	e8 75 ff ff ff       	call   80107600 <setupkvm>
8010768b:	a3 c4 d6 11 80       	mov    %eax,0x8011d6c4
  lcr3(V2P(kpgdir));   // switch to the kernel page table
80107690:	05 00 00 00 80       	add    $0x80000000,%eax
80107695:	0f 22 d8             	mov    %eax,%cr3
}
80107698:	c9                   	leave  
80107699:	c3                   	ret    
8010769a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

801076a0 <clearpteu>:

// Clear PTE_U on a page. Used to create an inaccessible
// page beneath the user stack.
void
clearpteu(pde_t *pgdir, char *uva)
{
801076a0:	55                   	push   %ebp
801076a1:	89 e5                	mov    %esp,%ebp
801076a3:	83 ec 08             	sub    $0x8,%esp
801076a6:	8b 45 0c             	mov    0xc(%ebp),%eax
  if(*pde & PTE_P){
801076a9:	8b 55 08             	mov    0x8(%ebp),%edx
  pde = &pgdir[PDX(va)];
801076ac:	89 c1                	mov    %eax,%ecx
801076ae:	c1 e9 16             	shr    $0x16,%ecx
  if(*pde & PTE_P){
801076b1:	8b 14 8a             	mov    (%edx,%ecx,4),%edx
801076b4:	f6 c2 01             	test   $0x1,%dl
801076b7:	75 17                	jne    801076d0 <clearpteu+0x30>
  pte_t *pte;

  pte = walkpgdir(pgdir, uva, 0);
  if(pte == 0)
    panic("clearpteu");
801076b9:	83 ec 0c             	sub    $0xc,%esp
801076bc:	68 0a 83 10 80       	push   $0x8010830a
801076c1:	e8 ba 8c ff ff       	call   80100380 <panic>
801076c6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
801076cd:	8d 76 00             	lea    0x0(%esi),%esi
  return &pgtab[PTX(va)];
801076d0:	c1 e8 0a             	shr    $0xa,%eax
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
801076d3:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
  return &pgtab[PTX(va)];
801076d9:	25 fc 0f 00 00       	and    $0xffc,%eax
801076de:	8d 84 02 00 00 00 80 	lea    -0x80000000(%edx,%eax,1),%eax
  if(pte == 0)
801076e5:	85 c0                	test   %eax,%eax
801076e7:	74 d0                	je     801076b9 <clearpteu+0x19>
  *pte &= ~PTE_U;
801076e9:	83 20 fb             	andl   $0xfffffffb,(%eax)
}
801076ec:	c9                   	leave  
801076ed:	c3                   	ret    
801076ee:	66 90                	xchg   %ax,%ax

801076f0 <copyuvm>:

// Given a parent process's page table, create a copy
// of it for a child.
pde_t*
copyuvm(pde_t *pgdir, uint sz)
{
801076f0:	55                   	push   %ebp
801076f1:	89 e5                	mov    %esp,%ebp
801076f3:	57                   	push   %edi
801076f4:	56                   	push   %esi
801076f5:	53                   	push   %ebx
801076f6:	83 ec 1c             	sub    $0x1c,%esp
  pde_t *d;
  pte_t *pte;
  uint pa, i, flags;
  char *mem;

  if((d = setupkvm()) == 0)
801076f9:	e8 02 ff ff ff       	call   80107600 <setupkvm>
801076fe:	89 45 e0             	mov    %eax,-0x20(%ebp)
80107701:	85 c0                	test   %eax,%eax
80107703:	0f 84 be 00 00 00    	je     801077c7 <copyuvm+0xd7>
    return 0;
  for(i = 0; i < sz; i += PGSIZE){
80107709:	8b 4d 0c             	mov    0xc(%ebp),%ecx
8010770c:	85 c9                	test   %ecx,%ecx
8010770e:	0f 84 b3 00 00 00    	je     801077c7 <copyuvm+0xd7>
80107714:	31 f6                	xor    %esi,%esi
80107716:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010771d:	8d 76 00             	lea    0x0(%esi),%esi
  if(*pde & PTE_P){
80107720:	8b 4d 08             	mov    0x8(%ebp),%ecx
  pde = &pgdir[PDX(va)];
80107723:	89 f0                	mov    %esi,%eax
80107725:	c1 e8 16             	shr    $0x16,%eax
  if(*pde & PTE_P){
80107728:	8b 04 81             	mov    (%ecx,%eax,4),%eax
8010772b:	a8 01                	test   $0x1,%al
8010772d:	75 11                	jne    80107740 <copyuvm+0x50>
    if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
      panic("copyuvm: pte should exist");
8010772f:	83 ec 0c             	sub    $0xc,%esp
80107732:	68 14 83 10 80       	push   $0x80108314
80107737:	e8 44 8c ff ff       	call   80100380 <panic>
8010773c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  return &pgtab[PTX(va)];
80107740:	89 f2                	mov    %esi,%edx
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
80107742:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  return &pgtab[PTX(va)];
80107747:	c1 ea 0a             	shr    $0xa,%edx
8010774a:	81 e2 fc 0f 00 00    	and    $0xffc,%edx
80107750:	8d 84 10 00 00 00 80 	lea    -0x80000000(%eax,%edx,1),%eax
    if((pte = walkpgdir(pgdir, (void *) i, 0)) == 0)
80107757:	85 c0                	test   %eax,%eax
80107759:	74 d4                	je     8010772f <copyuvm+0x3f>
    if(!(*pte & PTE_P))
8010775b:	8b 18                	mov    (%eax),%ebx
8010775d:	f6 c3 01             	test   $0x1,%bl
80107760:	0f 84 92 00 00 00    	je     801077f8 <copyuvm+0x108>
      panic("copyuvm: page not present");
    pa = PTE_ADDR(*pte);
80107766:	89 df                	mov    %ebx,%edi
    flags = PTE_FLAGS(*pte);
80107768:	81 e3 ff 0f 00 00    	and    $0xfff,%ebx
    pa = PTE_ADDR(*pte);
8010776e:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
    if((mem = kalloc()) == 0)
80107774:	e8 27 af ff ff       	call   801026a0 <kalloc>
80107779:	85 c0                	test   %eax,%eax
8010777b:	74 5b                	je     801077d8 <copyuvm+0xe8>
      goto bad;
    memmove(mem, (char*)P2V(pa), PGSIZE);
8010777d:	83 ec 04             	sub    $0x4,%esp
80107780:	81 c7 00 00 00 80    	add    $0x80000000,%edi
80107786:	89 45 e4             	mov    %eax,-0x1c(%ebp)
80107789:	68 00 10 00 00       	push   $0x1000
8010778e:	57                   	push   %edi
8010778f:	50                   	push   %eax
80107790:	e8 1b d5 ff ff       	call   80104cb0 <memmove>
    if(mappages(d, (void*)i, PGSIZE, V2P(mem), flags) < 0)
80107795:	58                   	pop    %eax
80107796:	5a                   	pop    %edx
80107797:	53                   	push   %ebx
80107798:	8b 55 e4             	mov    -0x1c(%ebp),%edx
8010779b:	8b 45 e0             	mov    -0x20(%ebp),%eax
8010779e:	b9 00 10 00 00       	mov    $0x1000,%ecx
801077a3:	81 c2 00 00 00 80    	add    $0x80000000,%edx
801077a9:	52                   	push   %edx
801077aa:	89 f2                	mov    %esi,%edx
801077ac:	e8 5f f8 ff ff       	call   80107010 <mappages>
801077b1:	83 c4 10             	add    $0x10,%esp
801077b4:	85 c0                	test   %eax,%eax
801077b6:	78 20                	js     801077d8 <copyuvm+0xe8>
  for(i = 0; i < sz; i += PGSIZE){
801077b8:	81 c6 00 10 00 00    	add    $0x1000,%esi
801077be:	39 75 0c             	cmp    %esi,0xc(%ebp)
801077c1:	0f 87 59 ff ff ff    	ja     80107720 <copyuvm+0x30>
  return d;

bad:
  freevm(d);
  return 0;
}
801077c7:	8b 45 e0             	mov    -0x20(%ebp),%eax
801077ca:	8d 65 f4             	lea    -0xc(%ebp),%esp
801077cd:	5b                   	pop    %ebx
801077ce:	5e                   	pop    %esi
801077cf:	5f                   	pop    %edi
801077d0:	5d                   	pop    %ebp
801077d1:	c3                   	ret    
801077d2:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  freevm(d);
801077d8:	83 ec 0c             	sub    $0xc,%esp
801077db:	ff 75 e0             	push   -0x20(%ebp)
801077de:	e8 9d fd ff ff       	call   80107580 <freevm>
  return 0;
801077e3:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
801077ea:	83 c4 10             	add    $0x10,%esp
}
801077ed:	8b 45 e0             	mov    -0x20(%ebp),%eax
801077f0:	8d 65 f4             	lea    -0xc(%ebp),%esp
801077f3:	5b                   	pop    %ebx
801077f4:	5e                   	pop    %esi
801077f5:	5f                   	pop    %edi
801077f6:	5d                   	pop    %ebp
801077f7:	c3                   	ret    
      panic("copyuvm: page not present");
801077f8:	83 ec 0c             	sub    $0xc,%esp
801077fb:	68 2e 83 10 80       	push   $0x8010832e
80107800:	e8 7b 8b ff ff       	call   80100380 <panic>
80107805:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010780c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

80107810 <uva2ka>:

//PAGEBREAK!
// Map user virtual address to kernel address.
char*
uva2ka(pde_t *pgdir, char *uva)
{
80107810:	55                   	push   %ebp
80107811:	89 e5                	mov    %esp,%ebp
80107813:	8b 45 0c             	mov    0xc(%ebp),%eax
  if(*pde & PTE_P){
80107816:	8b 55 08             	mov    0x8(%ebp),%edx
  pde = &pgdir[PDX(va)];
80107819:	89 c1                	mov    %eax,%ecx
8010781b:	c1 e9 16             	shr    $0x16,%ecx
  if(*pde & PTE_P){
8010781e:	8b 14 8a             	mov    (%edx,%ecx,4),%edx
80107821:	f6 c2 01             	test   $0x1,%dl
80107824:	0f 84 00 01 00 00    	je     8010792a <uva2ka.cold>
  return &pgtab[PTX(va)];
8010782a:	c1 e8 0c             	shr    $0xc,%eax
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
8010782d:	81 e2 00 f0 ff ff    	and    $0xfffff000,%edx
  if((*pte & PTE_P) == 0)
    return 0;
  if((*pte & PTE_U) == 0)
    return 0;
  return (char*)P2V(PTE_ADDR(*pte));
}
80107833:	5d                   	pop    %ebp
  return &pgtab[PTX(va)];
80107834:	25 ff 03 00 00       	and    $0x3ff,%eax
  if((*pte & PTE_P) == 0)
80107839:	8b 84 82 00 00 00 80 	mov    -0x80000000(%edx,%eax,4),%eax
  if((*pte & PTE_U) == 0)
80107840:	89 c2                	mov    %eax,%edx
  return (char*)P2V(PTE_ADDR(*pte));
80107842:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  if((*pte & PTE_U) == 0)
80107847:	83 e2 05             	and    $0x5,%edx
  return (char*)P2V(PTE_ADDR(*pte));
8010784a:	05 00 00 00 80       	add    $0x80000000,%eax
8010784f:	83 fa 05             	cmp    $0x5,%edx
80107852:	ba 00 00 00 00       	mov    $0x0,%edx
80107857:	0f 45 c2             	cmovne %edx,%eax
}
8010785a:	c3                   	ret    
8010785b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010785f:	90                   	nop

80107860 <copyout>:
// Copy len bytes from p to user address va in page table pgdir.
// Most useful when pgdir is not the current page table.
// uva2ka ensures this only works for PTE_U pages.
int
copyout(pde_t *pgdir, uint va, void *p, uint len)
{
80107860:	55                   	push   %ebp
80107861:	89 e5                	mov    %esp,%ebp
80107863:	57                   	push   %edi
80107864:	56                   	push   %esi
80107865:	53                   	push   %ebx
80107866:	83 ec 0c             	sub    $0xc,%esp
80107869:	8b 75 14             	mov    0x14(%ebp),%esi
8010786c:	8b 45 0c             	mov    0xc(%ebp),%eax
8010786f:	8b 55 10             	mov    0x10(%ebp),%edx
  char *buf, *pa0;
  uint n, va0;

  buf = (char*)p;
  while(len > 0){
80107872:	85 f6                	test   %esi,%esi
80107874:	75 51                	jne    801078c7 <copyout+0x67>
80107876:	e9 a5 00 00 00       	jmp    80107920 <copyout+0xc0>
8010787b:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
8010787f:	90                   	nop
  return (char*)P2V(PTE_ADDR(*pte));
80107880:	81 e3 00 f0 ff ff    	and    $0xfffff000,%ebx
80107886:	8d 8b 00 00 00 80    	lea    -0x80000000(%ebx),%ecx
    va0 = (uint)PGROUNDDOWN(va);
    pa0 = uva2ka(pgdir, (char*)va0);
    if(pa0 == 0)
8010788c:	81 fb 00 00 00 80    	cmp    $0x80000000,%ebx
80107892:	74 75                	je     80107909 <copyout+0xa9>
      return -1;
    n = PGSIZE - (va - va0);
80107894:	89 fb                	mov    %edi,%ebx
    if(n > len)
      n = len;
    memmove(pa0 + (va - va0), buf, n);
80107896:	89 55 10             	mov    %edx,0x10(%ebp)
    n = PGSIZE - (va - va0);
80107899:	29 c3                	sub    %eax,%ebx
8010789b:	81 c3 00 10 00 00    	add    $0x1000,%ebx
801078a1:	39 f3                	cmp    %esi,%ebx
801078a3:	0f 47 de             	cmova  %esi,%ebx
    memmove(pa0 + (va - va0), buf, n);
801078a6:	29 f8                	sub    %edi,%eax
801078a8:	83 ec 04             	sub    $0x4,%esp
801078ab:	01 c1                	add    %eax,%ecx
801078ad:	53                   	push   %ebx
801078ae:	52                   	push   %edx
801078af:	51                   	push   %ecx
801078b0:	e8 fb d3 ff ff       	call   80104cb0 <memmove>
    len -= n;
    buf += n;
801078b5:	8b 55 10             	mov    0x10(%ebp),%edx
    va = va0 + PGSIZE;
801078b8:	8d 87 00 10 00 00    	lea    0x1000(%edi),%eax
  while(len > 0){
801078be:	83 c4 10             	add    $0x10,%esp
    buf += n;
801078c1:	01 da                	add    %ebx,%edx
  while(len > 0){
801078c3:	29 de                	sub    %ebx,%esi
801078c5:	74 59                	je     80107920 <copyout+0xc0>
  if(*pde & PTE_P){
801078c7:	8b 5d 08             	mov    0x8(%ebp),%ebx
  pde = &pgdir[PDX(va)];
801078ca:	89 c1                	mov    %eax,%ecx
    va0 = (uint)PGROUNDDOWN(va);
801078cc:	89 c7                	mov    %eax,%edi
  pde = &pgdir[PDX(va)];
801078ce:	c1 e9 16             	shr    $0x16,%ecx
    va0 = (uint)PGROUNDDOWN(va);
801078d1:	81 e7 00 f0 ff ff    	and    $0xfffff000,%edi
  if(*pde & PTE_P){
801078d7:	8b 0c 8b             	mov    (%ebx,%ecx,4),%ecx
801078da:	f6 c1 01             	test   $0x1,%cl
801078dd:	0f 84 4e 00 00 00    	je     80107931 <copyout.cold>
  return &pgtab[PTX(va)];
801078e3:	89 fb                	mov    %edi,%ebx
    pgtab = (pte_t*)P2V(PTE_ADDR(*pde));
801078e5:	81 e1 00 f0 ff ff    	and    $0xfffff000,%ecx
  return &pgtab[PTX(va)];
801078eb:	c1 eb 0c             	shr    $0xc,%ebx
801078ee:	81 e3 ff 03 00 00    	and    $0x3ff,%ebx
  if((*pte & PTE_P) == 0)
801078f4:	8b 9c 99 00 00 00 80 	mov    -0x80000000(%ecx,%ebx,4),%ebx
  if((*pte & PTE_U) == 0)
801078fb:	89 d9                	mov    %ebx,%ecx
801078fd:	83 e1 05             	and    $0x5,%ecx
80107900:	83 f9 05             	cmp    $0x5,%ecx
80107903:	0f 84 77 ff ff ff    	je     80107880 <copyout+0x20>
  }
  return 0;
}
80107909:	8d 65 f4             	lea    -0xc(%ebp),%esp
      return -1;
8010790c:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
}
80107911:	5b                   	pop    %ebx
80107912:	5e                   	pop    %esi
80107913:	5f                   	pop    %edi
80107914:	5d                   	pop    %ebp
80107915:	c3                   	ret    
80107916:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
8010791d:	8d 76 00             	lea    0x0(%esi),%esi
80107920:	8d 65 f4             	lea    -0xc(%ebp),%esp
  return 0;
80107923:	31 c0                	xor    %eax,%eax
}
80107925:	5b                   	pop    %ebx
80107926:	5e                   	pop    %esi
80107927:	5f                   	pop    %edi
80107928:	5d                   	pop    %ebp
80107929:	c3                   	ret    

8010792a <uva2ka.cold>:
  if((*pte & PTE_P) == 0)
8010792a:	a1 00 00 00 00       	mov    0x0,%eax
8010792f:	0f 0b                	ud2    

80107931 <copyout.cold>:
80107931:	a1 00 00 00 00       	mov    0x0,%eax
80107936:	0f 0b                	ud2    
